Пример #1
0
        public MainForm()
        {
            this.InitializeComponent();

            FormViewAsTableControl formView = new FormViewAsTableControl();

            ReflectionFormModel refFormModel = new ReflectionFormModel();

            refFormModel.FormType   = typeof(Prueba);
            refFormModel.FormObject = new Prueba();
            formView.FormModel      = refFormModel;

            Control control = ((IRefControl)formView).Control;

            control.Dock = DockStyle.Fill;
            this.Controls.Add(control);
        }
Пример #2
0
        /// <summary>
        ///     Punto de entrada principal para la aplicación.
        /// </summary>
        internal static void Main_2(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());

            Property <int> iproperty = new Property <int>();

            iproperty.Name          = "Propiedad1";
            iproperty.NameUI        = "Propiedad 1";
            iproperty.DescriptionUI = "Propiedad 1";
            iproperty.Value         = 50;
            iproperty.Editable      = true;
            iproperty.Enabled       = true;

            ReflectionFormModel refFormModel = new ReflectionFormModel();

            refFormModel.FormType   = typeof(Prueba);
            refFormModel.FormObject = new Prueba();

            ComposedComponentUI menu1 = new ComposedComponentUI();

            menu1.Name          = "Menu1";
            menu1.NameUI        = "Menú ";
            menu1.DescriptionUI = "Menú 1";
            menu1.Components.Add(new Action()
            {
                NameUI = "Acción 1", DescriptionUI = "Acción 1"
            });
            menu1.Components.Add(new Action()
            {
                NameUI = "Acción 2", DescriptionUI = "Acción 2"
            });

            menu1.Components.Add(iproperty);

            ComposedComponentUI menu2 = new ComposedComponentUI();

            menu2.Name          = "Menu2";
            menu2.NameUI        = "Menú 2";
            menu2.DescriptionUI = "Menú ";
            menu2.Components.Add(new Action()
            {
                NameUI = "Acción 1", DescriptionUI = "Acción 1"
            });
            menu2.Components.Add(new Action()
            {
                NameUI = "Acción 2", DescriptionUI = "Acción 2"
            });

            menu2.Components.Add(iproperty);

            DialogViewControl <Form> dialog = new DialogViewControl <Form>();

            IFormView formView = new FormViewAsTableControl();

            formView.FormModel = refFormModel;

            IMenuView menuView = new MenuViewControl <MenuStrip>();

            menuView.Components.Add(menu1);
            menuView.Components.Add(menu2);
            menuView.Components.Add(iproperty);

            Drawing3DViewControl <Drawing3DOSGControl> drawing3DView = new Drawing3DViewControl <Drawing3DOSGControl>();

            dialog.AddView(menuView, DockConstraints.Top);
            dialog.AddView(drawing3DView, DockConstraints.Fill);
            dialog.AddView(formView, DockConstraints.Bottom);

            Application.Run((Form)((IRefControl)dialog).Control);
        }