private void PureLogicChanged(Type newLogic, Control pureLogicContainer) { foreach (var child in pureLogicContainer.Controls.First().Controls.ToList()) { pureLogicContainer.Controls.First().Remove(child); } _pureLogicEditor = new ObjectEditor <PureLogic>(Manager, pureLogicContainer); if (newLogic == _node.BindedLogic.PureLogic.GetType()) { _pureLogicEditor.SetInstance(_node.BindedLogic.PureLogic); } var interfaceCreated = _pureLogicEditor.CreateInterface(newLogic); if (interfaceCreated) { pureLogicContainer.Visible = true; pureLogicEditing.Height = pureLogicContainer.Height + 16 * 5; } else { pureLogicContainer.Visible = false; pureLogicEditing.Height = 80; } Show(); }
public void CreateInterface(Node node) { foreach (var child in Controls.First().Controls.ToList()) { Controls.First().Remove(child); } _node = node; int yPos = 16; // Create the node editing section var nodeEditing = new GroupPanel(Manager) { Text = "Node Details" }; nodeEditing.Init(); // nodeEditing.Anchor = Anchors.Left | Anchors.Right | Anchors.Top; nodeEditing.Left = 16; nodeEditing.Top = yPos; nodeEditing.Width = Width - 48; nodeEditing.Parent = this; nodeEditing.Visible = true; _nodeEditor = new ObjectEditor <Node>(Manager, nodeEditing); _nodeEditor.SetInstance(node); _nodeEditor.CreateInterface(); yPos += nodeEditing.Height + 16; // Create the binded logic section var bindedLogicEditing = new GroupPanel(Manager) { Text = "Node Details" }; bindedLogicEditing.Init(); //bindedLogicEditing.Anchor = Anchors.Left | Anchors.Right | Anchors.Top; bindedLogicEditing.Left = 16; bindedLogicEditing.Top = yPos; bindedLogicEditing.Width = Width - 48; bindedLogicEditing.Parent = this; bindedLogicEditing.Visible = true; _bindedLogicEditor = new ObjectEditor <BindedLogic>(Manager, bindedLogicEditing); _bindedLogicEditor.SetInstance(node.BindedLogic); _bindedLogicEditor.CreateInterface(); yPos += bindedLogicEditing.Height + 16; // Create the pure logic section pureLogicEditing = new GroupPanel(Manager) { Text = "Node Details", AutoScroll = true, Left = 16, Top = yPos, Width = Width - 48, Parent = this, Visible = true, Height = 80 }; pureLogicEditing.Init(); CreatePureLogicEditor(pureLogicEditing); Invalidate(); Refresh(); pureLogicEditing.Invalidate(); pureLogicEditing.Refresh(); }