public void Setup(FormCreator_ designer) { _SetupFlag = true; _designer = designer; // Form Size & Form Panels typeof(enForm_Size).zEnum_To_IList(comboBox_FormSize.Items); //IamWindows.libUI.WinForms.Controls.ComboBox.SearchItem(comboBox_FormSize, designer.FormSize.ToString()); typeof(enForm_Panels).zEnum_To_IList(comboBox_FormPanels.Items); IamWindows.libUI.WinForms.Controls.ComboBox.SearchItem(comboBox_FormPanels, designer.Panel_Setup.ToString()); // Panel setup input_Panel1.Field_Value = UIDesigner_Component.Component_AsStr(_designer.Panel_Main, true, true); listBox_Components.Items.Clear(); _host = UIDesigner_Service.IDesignerHost_FromComponent(designer); if (_host != null) { // Set event UIDesigner_Tools.Host_Controls_SelectionChange(_host, OnselectionChanged); this.Closed -= OnFormClosed; this.Closed += OnFormClosed; // Find all controls on the form _components = UIDesigner_Tools.Host_Components_All(_host); _controls = UIDesigner_Tools.Host_Controls_All(_host); UIDesigner_Component.ControlNames(_components).zTo_IList(listBox_Components.Items); // Populate the list of classes that can be generated Assembly assembly = LamedalCore_.Instance.Types.Assembly.From_Object(designer); List <string> typeNameList; if (IamWindows.libUI.WinForms.FormGenerate.AssemblyTypes(assembly, out typeNameList, out _typeAttributeDictionary)) { typeNameList.zTo_IList(listBox_Classes.Items); listBox_Classes.SelectedIndex = 0; } this.TopMost = true; this.Show(); } _SetupFlag = false; }
private void OnFormClosed(object sender, EventArgs e) { UIDesigner_Tools.Host_Controls_SelectionChange(_host, OnselectionChanged, true); // Set the events }