Пример #1
0
        static void Main()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            enVars = new environmentVarsCore();

            // Instantiating the delegate for update data from child forms
            updateMainApp = updateMain;

            // set customization option
            enVars.customization.hasCodedCustomizationSettings = true;

            // check for customization file
            if (!LoadCustomizationFile())
            {
                return;
            }

            // check if local settings files exists
            FileInfo settingsFile;

            settingsFile = new FileInfo(Path.Combine(enVars.libraryPath, "settings.eon"));
            settingsFile.Refresh();
            if (enVars.customization.hasLocalSettings & settingsFile.Exists)
            {
                // LOAD LOCAL SETTING
                loadLocalSettings();
            }

            // LOAD CONFIG MENU TREE
            var loadMenu = new menuOptions();

            enVars = loadMenu.Load(enVars);

            // TODO: LOAD USER DEFINED MENU TREE

            // Load assemblies across multiple locations
            var loadAssemblies = new assembliesToLoadClass();

            enVars = loadAssemblies.Load(enVars);
            // TODO: LOAD USER BOUGHT ASSEMBLIES (PACKAGES, WIDGETS, LAYOUTS)
            // loadUserAssemblies()

            // TODO REVIEW
            // LOAD CONFIG API CALL IDS
            loadAPItasksIDs();

            // LOAD CONFIG STATIC TEMPLATE FILES AUTHORIZED
            loadAuthorizedFileTemplates();

            // TODO: CHECK CORE FILES UPDATES
            // check if there are any downloaded core files to be updated

            // LOAD STARTUP FORM
            loadStartupForm();

            // LOAD MAIN LAYOUT ASSEMBLY
            EnvironmentAssembliesLoadClass AssembliesLoader = new EnvironmentAssembliesLoadClass(enVars);

            Type           loadedType;
            FormCustomized mainForm;

            loadedType = AssembliesLoader.LoadObjectTypeFromAssembly(enVars.customization.designLayoutCustomAssemblyFileName, enVars.customization.designLayoutCustomAssemblyNameSpace, "mainAppLayoutForm");
            if (loadedType is null)
            {
                loadedType = AssembliesLoader.LoadObjectTypeFromAssembly(enVars.customization.designLayoutAssemblyFileName, enVars.customization.designLayoutAssemblyNameSpace, "mainAppLayoutForm");
                if (loadedType is null)
                {
                    MessageBox.Show("Error initializing main layout:" + AssembliesLoader.errorMessage);
                    Application.Exit();
                    return;
                }
            }
            //mainForm = Activator.CreateInstance(loadedType, enVars) as FormCustomized;
            // start the main layout
            Application.Run(new mainAppLayoutForm(enVars));
        }
Пример #2
0
        private void mainAppLayoutForm_shown(object sender, EventArgs e)
        {
            // ' needs to be the last
            if (ErrorLoading)
            {
                Application.Exit();
                return;
            }

            SuspendLayout();
            loaded = false;
            {
                var withBlock = panelLeftSide;
                withBlock.Parent     = this;
                withBlock.Width      = enVars.layoutDesign.menu.properties.ClosedStateSize;
                withBlock.BackColor  = Color.Transparent;
                withBlock.AutoScroll = true;
            }

            // TOP OPTIONS ON SIDE PANEL
            {
                var withBlock1 = panelMenuOptions;
                withBlock1.Parent = panelLeftSide;
                withBlock1.Dock   = DockStyle.Top;
                withBlock1.BringToFront();
            }

            // lateralPanelMenuOptions.BackColor = Color.FromArgb(50, Color.Red)

            menuToggleIcon.Parent      = panelMenuOptions;
            menuToggleIcon.BackColor   = Color.Transparent;
            menuToggleIcon.Width       = enVars.layoutDesign.MENU_CLOSED_STATE - 3;
            menuToggleIcon.Height      = enVars.layoutDesign.MENU_CLOSED_STATE - 3;
            iconMenuSettings.Parent    = panelMenuOptions;
            iconMenuSettings.BackColor = Color.Transparent;
            {
                var withBlock2 = panelMenuOptionsContainer;
                withBlock2.Parent = panelLeftSide;
                withBlock2.Height = 0;
                withBlock2.Dock   = DockStyle.Top;
                withBlock2.BringToFront();
            }

            menuBuilder = new MenuBuilderClass(this, panelLeftSide, enVars, MenuBuilderClass.MENU_VERTICAL);
            enVars      = menuBuilder.buildMenu();
            panelLeftSide.Controls.Add(enVars.layoutDesign.menu.menuPanelContainer);
            enVars.layoutDesign.menu.menuPanelContainer.BringToFront();
            menuBuilder.MenuUpdate(false);

            // TOP PANEL
            panelTop.Parent = this;

            // BOTTOM PANEL
            panelBottom.Parent   = this;
            statusText.Parent    = panelBottom;
            statusText.BackColor = Color.Transparent;
            statusMessage        = "status message test";
            updateBkColorAndTransparency(this, false, false);
            ResumeLayout();

            //  ASSEMBLY Manager
            AssembliesManager = new EnvironmentAssembliesLoadClass(enVars);
        }