Example #1
0
        public int GetIndexOfDataFile(string n, string s, string t)
        {
            DataFile checker = new DataFile(n, t, s);

            for (int i = 0; i < files.Count; i++)
            {
                if (files[i].Equals(checker))
                {
                    return(i);
                }
            }
            throw new Exception("this is bad");
        }
Example #2
0
        public DataFile GetDataFile(string n, string s, string t)
        {
            DataFile checker = new DataFile(n, t, s);

            foreach (DataFile d in files)
            {
                if (d.Equals(checker))
                {
                    return(d);
                }
            }
            throw new Exception("this is bad");
        }
Example #3
0
        public int CompareTo(object obj)
        {
            DataFile f         = (DataFile)obj;
            int      firstComp = f.type.CompareTo(type);

            if (firstComp == 0)
            {
                int secondComp = f.subject.CompareTo(subject);
                if (secondComp == 0)
                {
                    return(-f.name.CompareTo(name));
                }
                else
                {
                    return(-secondComp);
                }
            }
            else
            {
                return(-firstComp);
            }
        }
Example #4
0
        public override bool Equals(object obj)
        {
            DataFile d = (DataFile)obj;

            return(d.name == name && d.subject == subject && d.type == type);
        }