public static void Remove(EditScreenWindow window) { if (instance.ContainsKey(window.Key)) { instance.Remove(window.Key); } }
public static EditScreenWindow GetInstance(SolutionTreeNode node) { EditScreenWindow retVal = null; if (instance.ContainsKey(node.Key)) { retVal = instance[node.Key]; } else { retVal = RenderScreen(node, retVal); } return(retVal); }
private static EditScreenWindow RenderScreen(SolutionTreeNode node, EditScreenWindow retVal) { EditScreen Me = (EditScreen)node.Object; RadPropertyGrid propertyGrid = new RadPropertyGrid(); propertyGrid = new RadPropertyGrid(); propertyGrid.Dock = DockStyle.Fill; propertyGrid.SelectedObject = node.Object; propertyGrid.ToolbarVisible = true; propertyGrid.PropertySort = PropertySort.Categorized; EditScreenWindow window = new EditScreenWindow(propertyGrid); window.Key = node.Key; window.Tag = node; window.Text = node.Text; window.editors = GetCustomEditors(node.Object); window.onValueChangedCommands = GetValueChangedCommands(node.Object); //window.Controls.Add(window.PropertyGrid); TableLayoutPanel screen = new TableLayoutPanel(); screen.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; screen.ColumnCount = 1; screen.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); screen.RowCount = 3; screen.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 45F)); screen.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); screen.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); screen.Dock = DockStyle.Fill; //add textbox for title TextBox title = new TextBox(); title.Font = new System.Drawing.Font("Verdana", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); screen.Controls.Add(title, 0, 0); title.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); title.Location = new System.Drawing.Point(0, 0); title.DataBindings.Add("Text", Me, "Title.Name"); //add textbox for subtitle TextBox subtitle = new TextBox(); screen.Controls.Add(subtitle, 0, 1); subtitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); subtitle.Location = new System.Drawing.Point(0, 0); subtitle.DataBindings.Add("Text", Me, "SubTitle.Name"); TableLayoutPanel zoneContainer = SetupSectionZoneLayout(Me); screen.Controls.Add(zoneContainer, 0, 2); window.Controls.Add(screen); instance.Add(node.Key, window); retVal = window; return(retVal); }