void CreateCleanupTypeItemControl(CleanerItemUIInfo cleanupTypeItem) { var newControl = new CleanupItemUserControl() { Dock = DockStyle.Top, AutoSize = false, }; newControl.Init((CodeCleanerType)cleanupTypeItem.CleanerType); AllControls.Add(newControl); //if ((leftTableLayoutPanel.Height <= rightTableLayoutPanel.Height) && // (leftTableLayoutPanel.Height + newControl.Height <= mainPanel.Height || // rightTableLayoutPanel.Height >= mainPanel.Height)) //{ // leftTableLayoutPanel.Controls.Add(newControl); //} //else //{ // rightTableLayoutPanel.Controls.Add(newControl); //} //mainPanel.Controls.Add(newControl); // this.Height += newSubControl.Height; }
void CreateCleanupTypeItemControl(CleanerItemUIInfo cleanupTypeItem) { var newControl = new CleanupItemUserControl() { Dock = DockStyle.Top, AutoSize = false, TabIndex = TAB_INDEX_START++, }; newControl.Init((CodeCleanerType)cleanupTypeItem.CleanerType); mainPanel.Controls.Add(newControl); //this.Height += newSubControl.Height; }
void CreateControls() { CleanupItemUserControl.CreateControls(typeof(CodeCleanerType), cleanupTypeItem => CreateCleanupTypeItemControl(cleanupTypeItem), true); foreach (var itemControl in AllControls.OrderByDescending(x => x.Height)) { itemControl.TabIndex = TAB_INDEX_START++; if (rightTableLayoutPanel.Height + itemControl.Height >= leftTableLayoutPanel.Height) { leftTableLayoutPanel.Controls.Add(itemControl); } else { rightTableLayoutPanel.Controls.Add(itemControl); } } }
void CreateCleanupTypeItemControl(CleanerItemUIInfo cleanupTypeItem) { using (var newControl = new CleanupItemUserControl() { Dock = DockStyle.Top, AutoSize = false, }) { newControl.Init((CodeCleanerType)cleanupTypeItem.CleanerType); AllControls.Add(newControl); } //var newControl = new CleanupItemUserControl() //{ // Dock = DockStyle.Top, // AutoSize = false, //}; //newControl.Init((CodeCleanerType)cleanupTypeItem.CleanerType); //AllControls.Add(newControl); }
void CreateControls() { CleanupItemUserControl.CreateControls(typeof(CodeCleanerType), cleanupTypeItem => CreateCleanupTypeItemControl(cleanupTypeItem), true); }