Ejemplo n.º 1
0
 private void AddButtonToPanel(FlowLayoutPanel panel, ToolModel toolModel)
 {
     ToolButton buttonTool = new ToolButton();
     buttonTool.Text = toolModel.TextButton;
     buttonTool.Action = toolModel.ActionButton;
     buttonTool.Click += ButtonTool_Click;
     panel.Controls.Add(buttonTool);
 }
        public void SaveDummyModel()
        {
            //given --
            DynamicFormModel dynamicModel = new DynamicFormModel();
            ToolModel toolModelNotePad = new ToolModel(textButton:"run", actionButton: "notepad.exe");
            ToolModel toolModelBrowser = new ToolModel(textButton: "navigate", actionButton: "www.google.com");
            dynamicModel.ToolModels = new[] {toolModelNotePad, toolModelBrowser };

            //when
            DynamicFormModelSerializer.WriteToXmlFile(dynamicModel, path: "Z:\\config.xml");
        }