コード例 #1
0
        public HttpDataCore(environmentVarsCore _state = default, string _overrideUrl = "")
        {
            RestartQueueTimer = new System.Timers.Timer();
            queue             = new List <_queue_data_struct>();
            dataStatistics    = new List <_data_statistics>();
            loadingCounter    = 0;
            sendToQueue       = false;
            if (_state is object && _overrideUrl.Equals(""))
            {
                url = _state.ServerBaseAddr + _state.ApiServerAddrPath;
            }
            else if (!_overrideUrl.Equals(""))
            {
                url = _overrideUrl;
            }
            else
            {
                throw new Exception("Initialization err: state and url cannot be both null at same time");
            }

            if (_state is object)
            {
                state = _state;
            }
        }
コード例 #2
0
    public static environmentVarsCore setupCustomizationVariables(environmentVarsCore enVars)
    {
        {
            enVars.customization.ApplicationBrandNAme                 = "MainTestApp";
            enVars.customization.designLayoutAssemblyFileName         = "ltbm.layout.dll";
            enVars.customization.designLayoutAssemblyNameSpace        = "AeonLabs.Layouts.Main";
            enVars.customization.designStartupLayoutAssemblyFileName  = "medieval.startup.layout.dll";
            enVars.customization.designStartupLayoutAssemblyNameSpace = "AeonLabs.Layouts.StartUp";
            enVars.customization.hasLogin                    = true;
            enVars.customization.hasSetup                    = true;
            enVars.customization.hasLocalSettings            = true;
            enVars.customization.hasCloudSettings            = true;
            enVars.customization.hasStaticAssemblies         = true;
            enVars.customization.hasDynamicAssemblies        = true;
            enVars.customization.hasStaticDocumentTemplates  = true;
            enVars.customization.hasDynamicDocumentTemplates = true;

            // TODO: replace by API ACCESS KEY string : office435dfgjdn4235
            enVars.customization.softwareAccessMode    = "humanResources"; // possible values: office, site, contractor, rh
            enVars.customization.expireDate            = "01/01/2021";
            enVars.customization.updateServerAddr      = "http://www.store.aeonlabs.solutions/index.php";
            enVars.customization.crashReportServerAddr = "http://www.sitelogistics.construction/shared/crash/api.php?task=crash";
            enVars.customization.websiteToLoadProgram  = "http://www.sitelogistics.construction";
        }

        return(enVars);
    }
コード例 #3
0
 public AesCipher(environmentVarsCore _state = default)
 {
     if (_state is object)
     {
         stateCore = _state;
     }
 }
コード例 #4
0
 public environmentVarsCore Load(environmentVarsCore _enVars)
 {
     enVars = _enVars;
     load_profile_menu();
     load_help_menu();
     return(enVars);
 }
コード例 #5
0
        public static environmentVarsCore loadExternalFilesInUse(environmentVarsCore envars)
        {
            envars.addExternalFileToLoad("menuMinimizeArrow", "uparrow.png");
            envars.addExternalFileToLoad("menuExpandArrow", "downarrow.png");
            envars.addExternalFileToLoad("noNetwork", "noNetwork.png");
            if (envars.stateErrorFound)
            {
                MessageBox.Show(envars.stateErrorMessage);
            }
            string testFilesExist = "";

            foreach (KeyValuePair <string, string> item in envars.externalFilesToLoad)
            {
                FileInfo AssembFile = new FileInfo(envars.imagesPath + item.Value);
                AssembFile.Refresh();
                if (!AssembFile.Exists)
                {
                    testFilesExist += item.Value + "; ";
                }
            }

            if (!testFilesExist.Equals(""))
            {
                Interaction.MsgBox("Could not load the following files: " + testFilesExist);
                return(default);
コード例 #6
0
 public LayoutStartUpForm(environmentVarsCore _envarsCore, ref environmentVarsCore.updateMainLayoutDelegate _updateMainApp)
 {
     // This call is required by the designer.
     InitializeComponent();
     // Add any initialization after the InitializeComponent() call.
     enVars                           = _envarsCore;
     updateMainApp                    = _updateMainApp;
     startupBackgroundTasks           = new startupBackgroundTasksClass(enVars);
     _VersionLabel.Name               = "VersionLabel";
     _cancelCard_lbl.Name             = "cancelCard_lbl";
     _statusMessage.Name              = "statusMessage";
     _titleLabel.Name                 = "titleLabel";
     _locationLabel.Name              = "locationLabel";
     _quoteOfTheDaySentenceLabel.Name = "quoteOfTheDaySentenceLabel";
     _versionTitleLabel.Name          = "versionTitleLabel";
     _TitleFlavourLabel.Name          = "TitleFlavourLabel";
     _websiteLink.Name                = "websiteLink";
     _progressbar.Name                = "progressbar";
     _panelLogin.Name                 = "panelLogin";
     _loginBtn.Name                   = "loginBtn";
     _cardId_lbl.Name                 = "cardId_lbl";
     _cardId.Name                     = "cardId";
     _access_code.Name                = "access_code";
     _codetxt.Name                    = "codetxt";
     _show_password.Name              = "show_password";
     _PanelLocationText.Name          = "PanelLocationText";
     _animatedBackGround.Name         = "animatedBackGround";
 }
コード例 #7
0
        static void Main()
        {
            environmentVarsCore enVars    = new environmentVarsCore();
            mainAppLayoutForm   mainForm2 = new mainAppLayoutForm(enVars);

            enVars.assemblies = initializeAssembly.AssembliesToLoadAtStart();
            Application.Run(mainForm2);
        }
コード例 #8
0
 /* TODO ERROR: Skipped EndRegionDirectiveTrivia */
 /* TODO ERROR: Skipped RegionDirectiveTrivia */
 public loadEnvironment(environmentVarsCore _enVars, int settings = -100)
 {
     enVars = _enVars;
     enVars.loadEnvironmentcoreDefaults();
     dataLoaded            = false;
     dataLoadedStatusQueue = 0;
     load(settings);
 }
コード例 #9
0
        private void startupBackgroundTasks_startUpTasksCompleted(object sender, environmentVarsCore enVarsResult)
        {
            enVars = enVarsResult;
            var dataUpdate = new updateMainAppClass();

            dataUpdate.envars     = enVars;
            dataUpdate.updateTask = updateMainAppClass.UPDATE_MAIN;
            updateMainApp.Invoke(this, dataUpdate);
            this.Close();
        }
コード例 #10
0
    public loadingForm(environmentVarsCore _enVars)
    {
        base.Load  += loadingForm_Load;
        base.Shown += loadingForm_shown;
        enVars      = _enVars;

        // This call is required by the designer.
        InitializeComponent();
        // Add any initialization after the InitializeComponent() call.
    }
コード例 #11
0
        public static string loadSentenceQuoteOfTheDay()
        {
            var    state      = new environmentVarsCore();
            string fileName   = Path.Combine(state.libraryPath, "quotes.eon");
            var    quotesFile = new FileInfo(fileName);
            var    sArray     = default(string[]);
            int    Index      = 0;

            Array.Resize(ref sArray, Index + 1);
            bool found = false;

            quotesFile.Refresh();
            if (quotesFile.Exists)
            {
                try
                {
                    // with Array
                    var fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                    var sReader = new StreamReader(fStream, Encoding.UTF8);
                    while (sReader.Peek() >= 0)
                    {
                        string line = sReader.ReadLine();
                        if (Information.IsNothing(line))
                        {
                            continue;
                        }

                        if (line.Equals(""))
                        {
                            continue;
                        }

                        Array.Resize(ref sArray, Index + 1);
                        sArray[Index] = line;
                        Index        += 1;
                    }

                    fStream.Close();
                    sReader.Close();
                }
                catch (Exception ex)
                {
                    return(ex.Message);
                }

                var rnd = new Random();
                VBMath.Randomize();
                return(sArray[rnd.Next(0, sArray.Length - 1)]);
            }
            else
            {
                return("quotes file not found");
            }
        }
コード例 #12
0
        public loadingForm(environmentVarsCore _enVars)
        {
            enVars = _enVars;

            // This call is required by the designer.
            InitializeComponent();
            _progressbar.Name = "progressbar";
            _Label1.Name      = "Label1";
            _exitAppLink.Name = "exitAppLink";
            // Add any initialization after the InitializeComponent() call.
        }
コード例 #13
0
        /* TODO ERROR: Skipped EndRegionDirectiveTrivia */
        /* TODO ERROR: Skipped RegionDirectiveTrivia */
        public void CopyFieldsFromCore(environmentVarsCore enVarsCore)
        {
            var bindingFlagsSelection = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public;
            var fieldValues           = enVarsCore.GetType().GetFields(bindingFlagsSelection);

            foreach (var field in fieldValues)
            {
                var       info    = GetType().GetMember(field.Name);
                FieldInfo meField = info[0] as FieldInfo;
                meField.SetValue(this, field.GetValue(enVarsCore));
            }
        }
コード例 #14
0
        public mainAppLayoutForm(environmentVarsCore _envars = default)
        {
            bwChangeBackground = new BackgroundWorker();
            Application.AddMessageFilter((IMessageFilter)this);
            ErrorLoading = false;

            // This call is required by the designer.
            this.SuspendLayout();
            InitializeComponent();
            if (_envars is object)
            {
                enVars = _envars;
            }

            enVars.layoutDesign.menu.properties.ClosedStateSize = LATERAL_MENU_OPEN_WIDTH;

            resources = new ResourceManager(GetType().Namespace + ".config.strings", Assembly.GetExecutingAssembly());

            // ASSIGN ASSEMBLIES TO PANELS
            assignControlToAssembly();

            // çheck if external files exist
            enVars = LayoutSettings.loadExternalFilesInUse(enVars);
            if (enVars is null)
            {
                ErrorLoading = true;
                Application.Exit();
                return;
            }
            // Instantiating the delegate for update data from child forms
            updateMainApp = updateMainAppLayout;

            // Me.InactivityTimeOut = enVars.AutomaticLogoutTime

            this.Visible = false;
            this.Opacity = 0;
            this.Refresh();
            registerConfigurableLayoutControls();
            addToolTips();
            if (ENABLE_TESTING_ENVIRONMENT)
            {
                enVars = TestingVars.loadTestingEnvironmentVars(enVars);
            }

            this.ResumeLayout();

            // ' needs to be the last
            if (!this.IsDisposed & !ErrorLoading)
            {
                this.Show();
            }
        }
コード例 #15
0
    public environmentVarsCore Load(environmentVarsCore _enVars)
    {
        enVars = _enVars;

        // menu properties
        enVars.layoutDesign.PanelBackColor         = Color.Black;
        enVars.layoutDesign.PanelTransparencyIndex = 70;
        enVars.layoutDesign.IconsDefaultSize       = 40;
        enVars.layoutDesign.PANEL_SCROOL_UNDERLAY  = 100;

        enVars.layoutDesign.menu.properties.ClosedStateSize = 40;
        enVars.layoutDesign.menu.properties.height          = 40;
        enVars.layoutDesign.menu.properties.width           = 400;
        enVars.layoutDesign.menu.properties.activeBarWidth  = 5;
        enVars.layoutDesign.menu.properties.activeBarColor  = Color.Orange;

        load_profile_menu();
        //load_menu_help();
        return(enVars);
    }
コード例 #16
0
        public lateralSettingsForm(environmentVarsCore _envars, ref environmentVarsCore.updateMainLayoutDelegate _updateMainApp)
        {
            SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            envars        = _envars;
            updateMainApp = _updateMainApp;

            // This call is required by the designer.
            SuspendLayout();
            InitializeComponent();
            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(envars.currentLang);
            var backGroundImageToolTip = new ToolTip();

            backGroundImageToolTip.SetToolTip(selectBackGroundImage, resources.GetString("backGroundImage", CultureInfo.CurrentCulture));
            var colorPalleteToolTip = new ToolTip();

            colorPalleteToolTip.SetToolTip(selectPanelBackColor, resources.GetString("colorPallete", CultureInfo.CurrentCulture));
            panelForm.BackColor = Color.FromArgb(Convert.ToInt32(envars.layoutDesign.PanelTransparencyIndex), envars.layoutDesign.PanelBackColor);
            ResumeLayout();
        }
コード例 #17
0
        public MenuBuilderClass(Form _mainform, PanelDoubleBuffer _menuPanel, environmentVarsCore _envars, int _menuOrientation, ref environmentVarsCore.updateMainLayoutDelegate _updateMainApp)
        {
            resources       = new ResourceManager(GetType().Namespace + ".config.strings", Assembly.GetExecutingAssembly());
            updateMainApp   = _updateMainApp;
            mainForm        = _mainform;
            enVars          = _envars;
            menuOrientation = _menuOrientation;
            menuPanel       = _menuPanel;
            if (enVars.layoutDesign.fontTitle.Families.Count() < 1)
            {
                Interaction.MsgBox("Font files not loaded properly:" + ToString());
                return;
            }

            var fontToMeasure = new Font(enVars.layoutDesign.fontTitle.Families[0], enVars.layoutDesign.subMenuTitleFontSize, FontStyle.Regular);
            var g             = mainForm.CreateGraphics();

            sizeOfString = g.MeasureString("PQWER", fontToMeasure);
            previousPanelTimer.Interval = 300;
            previousPanelTimer.Tick    += (_, __) => delayActiveBar();
        }
コード例 #18
0
        /* TODO ERROR: Skipped EndRegionDirectiveTrivia */
        /* TODO ERROR: Skipped RegionDirectiveTrivia */
        public void loadSettings()
        {
            changeDataLoadedState(true);
            var settings = new Settings.Settings(enVars);

            enVars = settings.load();
            if (settings.hasError)
            {
                enVars.settingsLoaded    = false;
                enVars.stateErrorMessage = settings.errorMessage;
                return;
            }

            var configFile = new FileInfo(Path.Combine(enVars.libraryPath, "ScrewDriver.cfg"));

            configFile.Refresh();
            if (configFile.Exists)
            {
                loadConfig();
            }

            changeDataLoadedState(false, LOAD_SETTINGS);
        }
コード例 #19
0
 public updateMainAppClass(environmentVarsCore _enVars = null, int _updateTask = default)
 {
     enVars     = _enVars;
     updateTask = _updateTask;
 }
コード例 #20
0
 public HttpDataGetData(environmentVarsCore _state = default, string _url = "") : base(_state, _url)
 {
 }
コード例 #21
0
        /* TODO ERROR: Skipped EndRegionDirectiveTrivia */
        /* TODO ERROR: Skipped RegionDirectiveTrivia */
        public void loadConfig()
        {
            changeDataLoadedState(true);
            var cfgstate = new environmentVarsCore();

            cfgstate.secretKey = enVars.secretKey;
            var encryption   = new AesCipher(cfgstate);
            var settingsFile = new FileInfo(Path.Combine(cfgstate.libraryPath, "ScrewDriver.cfg"));

            settingsFile.Refresh();
            if (settingsFile.Exists)
            {
                {
                    var withBlock = enVars;
                    try
                    {
                        var    bytes     = File.ReadAllBytes(Path.Combine(cfgstate.libraryPath, "ScrewDriver.cfg"));
                        string encrypted = Convert.ToBase64String(bytes, 0, bytes.Length);
                        string decrypted = encryption.decrypt(encrypted);
                        var    data      = JsonConvert.DeserializeObject <Dictionary <string, object> >(decrypted);

                        // datatable color schemes
                        withBlock.layoutDesign.buttonColor  = Color.FromArgb(Conversions.ToInteger(data["buttonColor"].ToString()));
                        withBlock.layoutDesign.dividerColor = Color.FromArgb(Conversions.ToInteger(data["dividerColor"].ToString()));
                        withBlock.colorSite                  = Color.FromArgb(Conversions.ToInteger(data["colorSite"].ToString()));
                        withBlock.colorSection               = Color.FromArgb(Conversions.ToInteger(data["colorSection"].ToString()));
                        withBlock.colorCompany               = Color.FromArgb(Conversions.ToInteger(data["colorCompany"].ToString()));
                        withBlock.colorWorkCategories        = Color.FromArgb(Conversions.ToInteger(data["colorWorkCategories"].ToString()));
                        withBlock.colorAbsense               = Color.FromArgb(Conversions.ToInteger(data["colorAbsense"].ToString()));
                        withBlock.colorWithoutRecord         = Color.FromArgb(Conversions.ToInteger(data["colorWithoutRecord"].ToString()));
                        withBlock.colorWeekends              = Color.FromArgb(Conversions.ToInteger(data["colorWeekends"].ToString()));
                        withBlock.colorHolidays              = Color.FromArgb(Conversions.ToInteger(data["colorHolidays"].ToString()));
                        withBlock.colorWithRecord            = Color.FromArgb(Conversions.ToInteger(data["colorWithRecord"].ToString()));
                        withBlock.colorAbsentDay             = Color.FromArgb(Conversions.ToInteger(data["colorAbsentDay"].ToString()));
                        withBlock.colorFermetureAnnual       = Color.FromArgb(Conversions.ToInteger(data["colorFermetureAnnual"].ToString()));
                        withBlock.colorPartialDayValidated   = Color.FromArgb(Conversions.ToInteger(data["colorPartialDayValidated"].ToString()));
                        withBlock.colorPlannedChangeOfSite   = Color.FromArgb(Conversions.ToInteger(data["colorPlannedChangeOfSite"].ToString()));
                        withBlock.colorPlannedTeam           = Color.FromArgb(Conversions.ToInteger(data["colorPlannedTeam"].ToString()));
                        withBlock.colorFullDayValidated      = Color.FromArgb(Conversions.ToInteger(data["colorFullDayValidated"].ToString()));
                        withBlock.layoutDesign.colorMainMenu = Color.FromArgb(Conversions.ToInteger(data["colorMainMenu"].ToString()));
                        // font files
                        withBlock.layoutDesign.fontTitleFile = data["fontTitleFile"].ToString();
                        withBlock.layoutDesign.fontTextFile  = data["fontTextFile"].ToString();
                        // delay Days Validation Attendance
                        withBlock.delayDaysValidationAttendance = Conversions.ToInteger(data["delayDaysValidationAttendance"].ToString());
                        withBlock.layoutDesign.fontTitle.AddFontFile(withBlock.fontsPath + withBlock.layoutDesign.fontTitleFile);
                        withBlock.layoutDesign.fontText.AddFontFile(withBlock.fontsPath + withBlock.layoutDesign.fontTextFile);
                    }
                    catch (Exception ex)
                    {
                        withBlock.stateErrorMessage = ex.ToString();
                    }
                }
            }
            else
            {
                System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(enVars.currentLang);
                enVars.stateErrorMessage = My.Resources.strings.errorDataFileNotFound;
            }

            changeDataLoadedState(false, LOAD_CONFIG);
        }
コード例 #22
0
    public static environmentVarsCore loadTestingEnvironmentVars(environmentVarsCore envars)
    {
        const int PROFILE  = 1;
        const int HELP     = 100;
        const int PROFILE2 = 200;
        const int PROFILE3 = 300;

        envars.customization.ApplicationBrandNAme                 = "MainTestApp";
        envars.customization.designLayoutAssemblyFileName         = "ltbm.layout.dll";
        envars.customization.designLayoutAssemblyNameSpace        = "AeonLabs.Layouts.Main";
        envars.customization.designStartupLayoutAssemblyFileName  = "medieval.startup.layout.dll";
        envars.customization.designStartupLayoutAssemblyNameSpace = "AeonLabs.Layouts.StartUp";
        envars.customization.hasLogin                    = true;
        envars.customization.hasSetup                    = true;
        envars.customization.hasLocalSettings            = true;
        envars.customization.hasCloudSettings            = true;
        envars.customization.hasStaticAssemblies         = true;
        envars.customization.hasDynamicAssemblies        = true;
        envars.customization.hasStaticDocumentTemplates  = true;
        envars.customization.hasDynamicDocumentTemplates = true;

        // TODO: replace by API ACCESS KEY string : office435dfgjdn4235
        envars.customization.softwareAccessMode    = "humanResources"; // possible values: office, site, contractor, rh
        envars.customization.expireDate            = "01/01/2021";
        envars.customization.updateServerAddr      = "http://www.store.aeonlabs.solutions/index.php";
        envars.customization.crashReportServerAddr = "http://www.sitelogistics.construction/shared/crash/api.php?task=crash";
        envars.customization.websiteToLoadProgram  = "http://www.sitelogistics.construction";



        envars.layoutDesign.PanelBackColor         = Color.Black;
        envars.layoutDesign.PanelTransparencyIndex = 70;
        envars.layoutDesign.IconsDefaultSize       = 40;
        envars.layoutDesign.PANEL_SCROOL_UNDERLAY  = 100;


        // MENUS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

        envars.layoutDesign.menu.properties.ClosedStateSize = 40;
        envars.layoutDesign.menu.properties.height          = 40;
        envars.layoutDesign.menu.properties.width           = 400;
        envars.layoutDesign.menu.properties.activeBarWidth  = 5;
        envars.layoutDesign.menu.properties.activeBarColor  = Color.Orange;


        // MENU PRIFILE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        envars.layoutDesign.menu.items = new System.Collections.Generic.List <menuItemClass>();
        var menuItem   = new menuItemClass();
        int subMenuIdx = 0;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "Menu 1";
        menuItem.friendlyUID            = "profile.dll";
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "usersProfileForm";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "icon.person.png";
        menuItem.subMenuIndex = 0;
        menuItem.menuIndex    = PROFILE;


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU SETTINGS
        menuItem    = new menuItemClass();
        subMenuIdx += 1;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "Submenu 1";
        menuItem.friendlyUID            = "settings.dll";
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = PROFILE;


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU LOGOUT
        menuItem    = new menuItemClass();
        subMenuIdx += 1;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "Subemenu 2";
        menuItem.friendlyUID            = null;
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = PROFILE;
        menuItem.tasks.Add(runInternalTask.LOGOUT.ToString());


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU EXIT APP
        menuItem    = new menuItemClass();
        subMenuIdx += 1;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "sub menu 3";
        menuItem.friendlyUID            = null;
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = false;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = PROFILE;
        menuItem.tasks.Add(runInternalTask.EXITAPP.ToString());

        envars.layoutDesign.menu.items.Add(menuItem);

        // MENU profile 2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        menuItem   = new menuItemClass();
        subMenuIdx = 0;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "menu 2";
        menuItem.friendlyUID            = "profile.dll";
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "usersProfileForm";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "icon.person.png";
        menuItem.subMenuIndex = 0;
        menuItem.menuIndex    = PROFILE2;


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU SETTINGS
        menuItem    = new menuItemClass();
        subMenuIdx += 1;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "sub menu 1";
        menuItem.friendlyUID            = "settings.dll";
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = PROFILE2;


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU LOGOUT
        menuItem    = new menuItemClass();
        subMenuIdx += 1;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "sub menu 2";
        menuItem.friendlyUID            = null;
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = PROFILE2;
        menuItem.tasks.Add(runInternalTask.LOGOUT.ToString());


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU EXIT APP
        menuItem    = new menuItemClass();
        subMenuIdx += 1;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "sub menu 3";
        menuItem.friendlyUID            = null;
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = false;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = PROFILE2;
        menuItem.tasks.Add(runInternalTask.EXITAPP.ToString());


        envars.layoutDesign.menu.items.Add(menuItem);

        // MENU PRIFILE 3++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        menuItem   = new menuItemClass();
        subMenuIdx = 0;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "menu 3";
        menuItem.friendlyUID            = "profile.dll";
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "usersProfileForm";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "icon.person.png";
        menuItem.subMenuIndex = 0;
        menuItem.menuIndex    = PROFILE3;


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU SETTINGS
        menuItem    = new menuItemClass();
        subMenuIdx += 1;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "sub menu 1";
        menuItem.friendlyUID            = "settings.dll";
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = PROFILE3;


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU LOGOUT
        menuItem    = new menuItemClass();
        subMenuIdx += 1;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "sub menu 2";
        menuItem.friendlyUID            = null;
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = PROFILE3;
        menuItem.tasks.Add(runInternalTask.LOGOUT.ToString());


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU EXIT APP
        menuItem    = new menuItemClass();
        subMenuIdx += 1;

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "sub menu 3";
        menuItem.friendlyUID            = null;
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = false;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = PROFILE3;
        menuItem.tasks.Add(runInternalTask.EXITAPP.ToString());


        envars.layoutDesign.menu.items.Add(menuItem);
        // MENU HELP ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        subMenuIdx = 0;
        menuItem   = new menuItemClass();

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "menu 4";
        menuItem.friendlyUID            = null;
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "icon.help.png";
        menuItem.subMenuIndex = 0;
        menuItem.menuIndex    = HELP;


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU CHECK FOR UPDATES
        subMenuIdx += 1;
        menuItem    = new menuItemClass();

        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "sub menu 1";
        menuItem.friendlyUID            = "update.dll";
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = true;
        menuItem.icon         = "";
        menuItem.subMenuIndex = subMenuIdx;
        menuItem.menuIndex    = HELP;


        envars.layoutDesign.menu.items.Add(menuItem);

        // SUB MENU ABOUT
        menuItem                        = new menuItemClass();
        subMenuIdx                     += 1;
        menuItem.menuUID                = Guid.NewGuid().ToString().Replace("-", "");
        menuItem.menuTitle              = "sub menu 2";
        menuItem.friendlyUID            = "about.dll";
        menuItem.formWithContentsToLoad = null;
        menuItem.nameSpaceString        = "";
        menuItem.showAsDialog           = true;
        menuItem.icon                   = "";
        menuItem.subMenuIndex           = subMenuIdx;
        menuItem.menuIndex              = HELP;
        envars.layoutDesign.menu.items.Add(menuItem);
        return(envars);
    }
コード例 #23
0
 public startupBackgroundTasksClass(environmentVarsCore _enVars)
 {
     state = _enVars;
 }
コード例 #24
0
 public HttpDataFilesUpload(environmentVarsCore _state = default, string _url = "") : base(_state, _url)
 {
 }
コード例 #25
0
 public HttpDataPostData(environmentVarsCore _state = default, string _overrideUrl = "") : base(_state, _overrideUrl)
 {
 }
コード例 #26
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));
        }
コード例 #27
0
 public Settings(environmentVarsCore _state)
 {
     state = _state;
 }
コード例 #28
0
 public void updateState(environmentVarsCore _state)
 {
     state = _state;
 }