void UpSelectPackage() { var name = (string)lbEnabled.SelectedItem; var index = listEnabled.IndexOf(name); if (index > 0) { listEnabled.RemoveAt(index); listEnabled.Insert(index - 1, name); XYPackage.PatchCurrentEnabled(listEnabled); UpdateEnabledPackageUI(); lbEnabled.SelectedIndex = index - 1; } }
void DownSelectPackage() { var name = (string)lbEnabled.SelectedItem; var maxIndex = listEnabled.Count - 1; var index = listEnabled.IndexOf(name); if (index < maxIndex) { listEnabled.RemoveAt(index); listEnabled.Insert(index + 1, name); XYPackage.PatchCurrentEnabled(listEnabled); UpdateEnabledPackageUI(); lbEnabled.SelectedIndex = index + 1; } }
void UpdateDisabledPackageData(string name) { listEnabled.Remove(name); listDisabled.Add(name); XYPackage.PatchCurrentEnabled(listEnabled); }