private static void UpdateOpenedWindowsToolStrip(BaseForm form, string addedText) { ToolStripButton item = new ToolStripButton(); item.Text = form.Text; item.DisplayStyle = ToolStripItemDisplayStyle.Image; item.ImageTransparentColor = System.Drawing.Color.Magenta; item.Name = MakeToolBarItemName(form); item.Tag = form; item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText; item.Click += new EventHandler(item_Click); m_openedWindowToolStrip.Items.Add(item); }
private static void AssignParameters(ref BaseForm form, params object[] parameters) { Type type = form.GetType(); if (parameters != null) { for (int i = 0; i < parameters.Length; i += 2) { PropertyInfo propertyInfo = type.GetProperty(parameters[i].ToString()); if (propertyInfo != null && propertyInfo.CanWrite) propertyInfo.SetValue(form, parameters[i + 1], null); } } }
private static string MakeToolBarItemName(BaseForm form) { return String.Format("{0}.Item", form.Key == null ? form.Name : form.Key); }
private static void AssignEventHandlers(BaseForm form) { form.FormClosed += new FormClosedEventHandler(formClosed); form.Activated += new EventHandler(form_Activated); form.Deactivate += new EventHandler(form_Deactivate); }