/// <summary> /// Post operation /// </summary> public override void Post() { uc.Writer = writer; IAssociatedObject ao = this.Object; object o = ao.Object; if (o is UserControlLabel) { UserControlLabel ucl = o as UserControlLabel; ucl.SetImage(Properties.Resources.SeverEvent.ToBitmap()); } }
void PostLoad() { // Create a new ContextMenuStrip control. ContextMenuStrip fruitContextMenuStrip = new ContextMenuStrip(); // Attach an event handler for the // ContextMenuStrip control's Opening event. // fruitContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(cms_Opening); // Create a new ToolStrip control. ToolStrip ts = new ToolStrip(); // Create a ToolStripDropDownButton control and add it // to the ToolStrip control's Items collections. ToolStripDropDownButton fruitToolStripDropDownButton = new ToolStripDropDownButton("Fruit", null, null, "Fruit"); ts.Items.Add(fruitToolStripDropDownButton); // Dock the ToolStrip control to the top of the form. ts.Dock = DockStyle.Top; // Assign the ContextMenuStrip control as the // ToolStripDropDownButton control's DropDown menu. fruitToolStripDropDownButton.DropDown = fruitContextMenuStrip; // Create a new MenuStrip control and add a ToolStripMenuItem. MenuStrip ms = new MenuStrip(); ToolStripMenuItem fruitToolStripMenuItem = new ToolStripMenuItem("Fruit", null, null, "Fruit"); ms.Items.Add(fruitToolStripMenuItem); // Dock the MenuStrip control to the top of the form. ms.Dock = DockStyle.Top; // Assign the MenuStrip control as the // ToolStripMenuItem's DropDown menu. fruitToolStripMenuItem.DropDown = fruitContextMenuStrip; // Assign the ContextMenuStrip to the form's // ContextMenuStrip property. //this.ContextMenuStrip = fruitContextMenuStrip; // Add the ToolStrip control to the Controls collection. //this.Controls.Add(ts); UserControlLabel p = this.FindParent <UserControlLabel>(); // ContextMenuStrip menu = new ContextMenuStrip(); if (rtime != null) { Dictionary <string, Dictionary <string, Tuple <Color[], bool, double[]> > > d = new Dictionary <string, Dictionary <string, Tuple <Color[], bool, double[]> > >(); foreach (string key in rtime.Item2.Keys) { Dictionary <string, Tuple <Color, bool, double[]> > dt = rtime.Item2[key]; Dictionary <string, Tuple <Color[], bool, double[]> > dtt = new Dictionary <string, Tuple <Color[], bool, double[]> >(); foreach (string kk in dt.Keys) { Tuple <Color, bool, double[]> tp = dt[kk]; dtt[kk] = new Tuple <Color[], bool, double[]>(new Color[] { tp.Item1 }, tp.Item2, tp.Item3); } d[key] = dtt; } realtime = new Tuple <double[], Dictionary <string, Dictionary <string, Tuple <Color[], bool, double[]> > > >(rtime.Item1, d); } if (cBuf != null) { colorsBuf = new Dictionary <string, Color[]>(); foreach (string key in cBuf.Keys) { colorsBuf[key] = new Color[] { cBuf[key] }; } cBuf = null; } if (colorsBuf != null) { foreach (string key in colorsBuf.Keys) { data.Item1[key] = colorsBuf[key]; } colorsBuf = null; } if (stepChartBuf != null) { foreach (string key in stepChartBuf.Keys) { data.Item2[key] = stepChartBuf[key]; } stepChartBuf = null; } if (textsBuf != null) { foreach (string key in textsBuf.Keys) { data.Item3[key] = textsBuf[key]; } textsBuf = null; } if (realtime != null) { data.Item6[0] = realtime; } this.FindChild <UserControlCadr>().Cadr = cadrNumber; }
/// <summary> /// Creates Wrapper /// </summary> /// <param name="label">Wrapped label</param> /// <param name="icon">Icon</param> /// <param name="changeSize">The "change size" sign</param> /// <returns>Wrapper</returns> static public IObjectLabelUI CreateLabelUI(this IObjectLabel label, object icon, bool changeSize) { return(UserControlLabel.CreateLabel(label, icon, changeSize)); }