public int Compare(object x, object y) { AaHeader item1 = x as AaHeader; AaHeader item2 = y as AaHeader; if (item1 == null || item2 == null) { throw new ArgumentException("xまたはyがAaItem型ではありません"); } string fn1 = Path.GetFileNameWithoutExtension(item1.FileName); string fn2 = Path.GetFileNameWithoutExtension(item2.FileName); return(fn1.CompareTo(fn2)); }
/// <summary> /// コレクションの指定したindexにitemを挿入 /// </summary> /// <param name="index"></param> /// <param name="item"></param> public void Insert(int index, AaHeader item) { List.Insert(index, item); }
/// <summary> /// itemをコレクションから削除 /// </summary> /// <param name="item"></param> public void Remove(AaHeader item) { List.Remove(item); }
/// <summary> /// itemをコレクションに追加 /// </summary> /// <param name="item"></param> /// <returns></returns> public int Add(AaHeader item) { return(List.Add(item)); }