protected List <string> GetAdded(DataStorage.SerializableStringDictionary keyValuePairs, DataStorage.ListBox listBox) { List <string> res = new List <string>(); List <string> SavedName = keyValuePairs.Keys.ToList(); for (int i = 0; i < TempName.Count; i++) { if (!SavedName.Contains(ConvertStrToSave(TempName[i])) && !listBox.DisabledIndices.Contains(i)) { res.Add(TempName[i]); } } return(res); }
protected List <string> GetChanged(DataStorage.SerializableStringDictionary keyValuePairs) { List <string> res = new List <string>(); List <string> SavedName = keyValuePairs.Keys.ToList(); for (int i = 0; i < TempName.Count; i++) { if (SavedName.Contains(ConvertStrToSave(TempName[i]))) { if (TempValue[i] != keyValuePairs.Values.ElementAt(SavedName.IndexOf(ConvertStrToSave(TempName[i])))) { res.Add(TempName[i]); } } } return(res); }
protected void SaveParams(List <string> ResultChanged, List <string> ResultAdded, DataStorage.SerializableStringDictionary KeyValuePairs) { string name; for (int i = 0; i < TempName.Count; i++) { name = ConvertStrToSave(TempName[i]); if (TempValue[i] != null) { if (KeyValuePairs.ContainsKey(name) && ResultChanged.Contains(TempName[i])) { KeyValuePairs[name] = TempValue[i]; } else if (ResultAdded.Contains(TempName[i])) { KeyValuePairs.Add(name, TempValue[i]); } } else { if (KeyValuePairs.ContainsKey(name) && ResultChanged.Contains(TempName[i])) { KeyValuePairs.Remove(name); } } } DataStorage.Settings.Default.Save(); DataStorage.Settings.Default.Reload(); }