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"); }
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"); }
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); } }
public override bool Equals(object obj) { DataFile d = (DataFile)obj; return(d.name == name && d.subject == subject && d.type == type); }