public override bool Equals(object obj)
 {
     if (obj is LabelModification)
     {
         LabelModification other = (LabelModification)obj;
         return(other.Name.Equals(Name));
     }
     return(false);
 }
 public void SetLabels(LabelModification[] sls)
 {
     deselectionMap = CreateDeselectionMap(sls);
     foreach (CheckedListBoxControl box in labelsListBoxes){
         foreach (LabelModification sl in sls){
             box.Add(sl.Name);
         }
     }
 }
 /// <summary>
 /// Creates list of LabelModification objects based on a list of names.
 /// </summary>
 /// <param name="names"></param>
 /// <returns></returns>
 private static LabelModification[] ToLabelMods(IList<string> names)
 {
     LabelModification[] result = new LabelModification[names.Count];
     for (int i = 0; i < result.Length; i++){
         result[i] = LabelModification.GetLabelByName(names[i]);
     }
     return result;
 }