protected void Add(string name, string value, DataStorage.ListBox listBox) { string NewName = name + " " + (Int32.Parse(listBox.Items[listBox.Items.Count - 1].ToString().Remove(0, name.Length + 1)) + 1).ToString(); TempName.Add(NewName); TempValue.Add(value); listBox.Items.Add(NewName); listBox.SelectedItem = NewName; }
protected void ControllDelete(Button del, DataStorage.ListBox listBox) { if (listBox.SelectedIndex < 16) { del.Enabled = false; } else if (!del.Enabled) { del.Enabled = true; } }
protected void Del(DataStorage.ListBox listBox) { int temp = listBox.SelectedIndex; listBox.DisableItem(temp); TempValue[temp] = null; for (int i = 1; i < listBox.Items.Count; i++) { if (temp + i < listBox.Items.Count && !listBox.DisabledIndices.Contains(temp + i)) { listBox.SelectedIndex = temp + i; break; } else if (temp - i >= 0 && !listBox.DisabledIndices.Contains(temp - i)) { listBox.SelectedIndex = temp - i; break; } } }
protected void Del(DataStorage.ListBox listBox, int index) { listBox.SelectedIndex = 0; listBox.DisableItem(index); TempValue[index] = null; }
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); }