/// <summary> /// 控制试图显示的方法 /// </summary> /// <param name="a"></param> public void setViewVisible(PackProcess a) { foreach (var element in d) { if (element.Key == a) { element.Value.Visible = true; } else { element.Value.Visible = false; } } }
public MainProTreeClickEventArgs(PackProcess _NodeType, WiFile _wifile) { NodeType = _NodeType; EditWiFile = _wifile; }
public void setMainProTreeEdited(PackProcess type) { }
public Table Table(Table dp, int proc) { // MessageBox.Show(dp.ToString(), "Hmm"); // MessageBox.Show(Microsoft.VisualBasic.Information.TypeName(dp), "Hmm2"); try { // MessageBox.Show(dp[1, "WERKS"], "Wow!"); } catch (Exception ex) { MessageBox.Show("Exception caught:" + ex.GetType() + ex.Message + ex.ToString(), "EXCEPTION"); } plants.Clear(); listBox1.BeginUpdate(); listBox1.Items.Clear(); try { Hashtable hash = new Hashtable(); ControlCollection cc; SplitContainer splitContainer = null; cc = splitContainer1.Panel1.Controls; foreach (_CSAPTaFacRow row in dp.Rows) { string strp = ((string)row.get_Value("AUTH")); string strtyp = ((string)row.get_Value("VPTYP")); string strr = ((string)row.get_Value("ROUTE")).Substring(3, 3); string strd = ((string)row.get_Value("VCTEXT")).Substring(7); /* MultiSelListBox code */ listBox1.Items.Add(strr + ": " + strd); /* Shiny new dynamic listview code */ Plant p; if (!plants.ContainsKey(strp)) { splitContainer = new SplitContainer(); splitContainer.Dock = DockStyle.Fill; cc.Add(splitContainer); cc = splitContainer.Panel2.Controls; p = new Plant(); p.name = strp; //splitContainer.SplitterDistance = 200; p.panel = splitContainer.Panel1; p.listView = new RouteListView(); p.listView.auth = strp; p.listView.HideSelection = false; p.listView.Sorting = SortOrder.Ascending; p.listView.AllowDrop = true; p.listView.Columns.Add("Route"); p.listView.Columns.Add("Description"); p.listView.View = View.Details; p.listView.Dock = DockStyle.Fill; p.panel.Controls.Add(p.listView); plants[strp] = p; Label lbl = new Label(); lbl.Text = "Plant " + strp; lbl.Dock = DockStyle.Top; p.panel.Controls.Add(lbl); splitContainers.Add(splitContainer); } else { p = plants[strp]; } RouteListViewItem i = new RouteListViewItem(strr, strd, strtyp, strp); i.BackColor = Color.FromArgb(255, ((16 * p.listView.Items.Count) % 255), ((16 * p.listView.Items.Count) % 255)); p.listView.Add(i); } if (splitContainer != null) { Control parent = splitContainer.Parent; parent.Controls.Remove(splitContainer); splitContainers.Remove(splitContainer); for (int i = splitContainer.Panel1.Controls.Count; i > 0; i--) { Control control = splitContainer.Panel1.Controls[0]; control.Parent.Controls.Remove(control); parent.Controls.Add(control); } splitContainer.Dispose(); splitContainer = null; } } catch (Exception ex) { MessageBox.Show("Caught:" + ex.Message); } listBox1.EndUpdate(); dp.AppendRow(); dp.AppendRow(); this.Dock = DockStyle.Fill; //this.Padding = new Padding(0, 0, 16, 16); ControlCollection cc2; SplitContainer splitContainer2 = null; cc2 = splitContainer1.Panel2.Controls; for (int i = 0; i < proc; i++) { PackProcess pk = new PackProcess(); splitContainer2 = new SplitContainer(); splitContainer2.Dock = DockStyle.Fill; cc2.Add(splitContainer2); cc2 = splitContainer2.Panel2.Controls; pk.listView = new RouteListView(); pk.name = "Process " + (i + 1); pk.listView.Sorting = SortOrder.Ascending; pk.listView.Dock = DockStyle.Fill; pk.listView.View = View.Details; pk.listView.AllowDrop = true; pk.listView.Columns.Add("Route"); pk.listView.Columns.Add("Description").AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); splitContainer2.Panel1.Controls.Add(pk.listView); packProcesses[i] = pk; Label lbl = new Label(); lbl.Dock = DockStyle.Top; lbl.Text = pk.name; splitContainer2.Panel1.Controls.Add(lbl); } if (splitContainer2 != null) { Control parent = splitContainer2.Parent; parent.Controls.Remove(splitContainer2); splitContainers.Remove(splitContainer2); for (int i = splitContainer2.Panel1.Controls.Count; i > 0; i--) { Control control = splitContainer2.Panel1.Controls[0]; control.Parent.Controls.Remove(control); parent.Controls.Add(control); } splitContainer2.Dispose(); splitContainer2 = null; } foreach (KeyValuePair <string, Plant> kvp in plants) { kvp.Value.listView.Columns[1].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); } foreach (KeyValuePair <int, PackProcess> kvp in packProcesses) { kvp.Value.listView.Columns[1].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); } return(dp); }