2 using System.Collections.Generic;
3 using System.ComponentModel;
7 using System.Windows.Forms;
9 namespace Sample_Environment_Control_Interface.Dialogs.Layout
13 public Seci.SerialisableList<SECI_Controls.Run_Information.Scaling_BlockViewer> current =
new Seci.SerialisableList<SECI_Controls.Run_Information.Scaling_BlockViewer>();
17 InitializeComponent();
22 for (
int i = 0; i < SECI_GUI.CurrentLayout.BlockViewers.Count; ++i)
24 SECI_Controls.Run_Information.Scaling_BlockViewer temp =
new SECI_Controls.Run_Information.Scaling_BlockViewer();
25 temp.Location = SECI_GUI.CurrentLayout.BlockViewers[i].Location;
26 temp.ItemsToShow = SECI_GUI.CurrentLayout.BlockViewers[i].ItemsToShow;
27 temp.TitleName = SECI_GUI.CurrentLayout.BlockViewers[i].TitleName;
28 temp.ShowTitle = SECI_GUI.CurrentLayout.BlockViewers[i].ShowTitle;
38 lstControls.Items.Clear();
39 lstItems.Items.Clear();
41 for (
int i = 0; i < current.Count; ++i)
43 lstControls.Items.Add(current[i].TitleName);
49 lstItems.Items.Clear();
51 if (lstControls.SelectedIndex != -1)
53 lstItems.Items.AddRange(current[lstControls.SelectedIndex].ItemsToShow.ToArray());
59 SECI_Controls.Run_Information.Edit_BlockViewer add =
new SECI_Controls.Run_Information.Edit_BlockViewer();
61 if (add.ShowDialog() == DialogResult.OK)
63 SECI_Controls.Run_Information.Scaling_BlockViewer temp =
new SECI_Controls.Run_Information.Scaling_BlockViewer();
64 temp.ChangeItemsToShow(add.blocksToShow, add.showTitle, add.name);
75 if (lstControls.SelectedIndex != -1)
77 SECI_Controls.Run_Information.Edit_BlockViewer edit =
new SECI_Controls.Run_Information.Edit_BlockViewer();
78 edit.blocksToShow = current[lstControls.SelectedIndex].ItemsToShow;
79 edit.name = current[lstControls.SelectedIndex].TitleName;
80 edit.showTitle = current[lstControls.SelectedIndex].ShowTitle;
82 if (edit.ShowDialog() == DialogResult.OK)
84 current[lstControls.SelectedIndex].ChangeItemsToShow(edit.blocksToShow, edit.showTitle, edit.name);
93 if (lstControls.SelectedIndex != -1)
95 current.RemoveAt(lstControls.SelectedIndex);
102 DialogResult = DialogResult.OK;