public override bool Equals(Object obj) { ServiceItemSortData arg = obj as ServiceItemSortData; if (arg == null) { return(false); } return(name.Equals(arg.Name) && subject.Equals(arg.Subject)); }
public int IndexOf(ServiceItemSetting a) { ServiceItemSortData data = new ServiceItemSortData(a.ServiceItem.FullName, a.Subject); int result = items.IndexOf(data); if (result < 0) { items.Add(data); result = items.Count - 1; } return(result); }
public void MoveAfter(ServiceItemSetting serviceSettingAfter, ServiceItemSetting serviceSetting) { int idx = IndexOf(serviceSetting); ServiceItemSortData data = items[idx]; if (idx < items.Count - 1) { items.RemoveAt(idx); int idx_after = IndexOf(serviceSettingAfter); items.Insert(idx_after + 1, data); modified = true; } }
public void MoveBefore(ServiceItemSetting serviceSettingBefore, ServiceItemSetting serviceSetting) { int idx = IndexOf(serviceSetting); ServiceItemSortData data = items[idx]; if (idx > 0) { items.RemoveAt(idx); int idx_before = IndexOf(serviceSettingBefore); items.Insert(idx_before, data); modified = true; } }