private void PopulateList() { var originalIndex = List.SelectedIndex; List.Items.Clear(); //Get Bar Graphs var barGraphs = BarGraphOptions.GetAvaliable(); //Get Pie Graphs - TODO var pieGraphs = PieGraphOptions.GetAvaliable(); _options = new List <SelectListObject>(); foreach (var n in barGraphs) { _options.Add(new SelectListObject(n, "Bar")); List.Items.Add("Bar - " + n); } foreach (var n in pieGraphs) { _options.Add(new SelectListObject(n, "Pie")); List.Items.Add("Pie - " + n); } if (List.Items.Count > 0) { List.SelectedIndex = originalIndex < List.Items.Count ? originalIndex : 0; StartButton.Enabled = true; EditButton.Enabled = true; DeleteButton.Enabled = true; CopyButton.Enabled = true; RenameButton.Enabled = true; ExportButton.Enabled = true; } else { StartButton.Enabled = false; EditButton.Enabled = false; DeleteButton.Enabled = false; CopyButton.Enabled = false; RenameButton.Enabled = false; ExportButton.Enabled = false; } }
private static void CreateDefaultTypes() { if (BarGraphOptions.GetAvaliable().Count == 0) { BarGraphOptions.CreateNew("Default"); } if (PieGraphOptions.GetAvaliable().Count == 0) { PieGraphOptions.CreateNew("Default"); } if (GiveawayOptions.GetAvaliable().Count == 0) { GiveawayOptions.CreateNew("Default"); } }