Пример #1
0
        bool Initialize()
        {
            // Load the Network settings from the MOG_SYSTEM_CONFIGFILENAME
            MOG_Ini pConfigFile = MOG_ControllerSystem.GetSystem().GetConfigFile();

            // Check if this server has a managed slave setting?
            if (pConfigFile.KeyExist("Slaves", "ManagedSlavesMax"))
            {
                // Initialize the Server's ManagedSlavesMax
                mManagedSlavesMax = pConfigFile.GetValue("Slaves", "ManagedSlavesMax");
            }

            return(true);
        }
Пример #2
0
        //------------------------------------------------------
        public void LoadCustomButtons(string platformName)
        {
            if (MOG_ControllerProject.IsProject())
            {
                UnloadCustomButtons();
                mPlatformName = platformName;

                // Get the project defaults
                string projectDefaultButtonsFile = MOG_ControllerProject.GetProject().GetProjectToolsPath() + "\\ClientConfigs\\" + MOG_ControllerProject.GetProject().GetProjectName() + ".Client.Buttons." + platformName + ".info";
                if (DosUtils.FileExist(projectDefaultButtonsFile))
                {
                    MOG_Ini pIni = new MOG_Ini(projectDefaultButtonsFile);

                    int i = 0;

                    string section = "BUTTON" + i;

                    while (pIni.SectionExist(section))
                    {
                        int val = pIni.GetValue(section, "TYPE");
                        // glk: This can be replaced by a bool instead of an int... (more clear)
                        int hide = pIni.GetValue(section, "HIDEWINDOW");
                        switch ((ETYPE)val)
                        {
                        case ETYPE.STD_BUTTON:
                            CreateStdButton(pIni.GetString(section, "BUTTONNAME"),
                                            pIni.GetString(section, "COMMAND"),
                                            pIni.GetString(section, "ARGUMENTS"),
                                            hide, section);
                            break;

                        case ETYPE.STD_BUTTON_EDIT:
                            CreateEditButton(pIni.GetString(section, "BUTTONNAME"),
                                             pIni.GetString(section, "FIELDNAME"),
                                             pIni.GetString(section, "ARGUMENTS"),
                                             pIni.GetString(section, "COMMAND"),
                                             hide, section);
                            break;

                        case ETYPE.STD_FILETYPE_LIST:
                            CreateFileTypeButton(pIni.GetString(section, "BUTTONNAME"),
                                                 pIni.GetString(section, "FIELDNAME"),
                                                 pIni.GetString(section, "DIRECTORY"),
                                                 pIni.GetString(section, "EXTENSION"),
                                                 pIni.GetString(section, "COMMAND"),
                                                 hide);
                            break;

                        case ETYPE.STD_FOLDERBROWSER:
                            CreateFileBrowser(pIni.GetString(section, "BUTTONNAME"),
                                              pIni.GetString(section, "FIELDNAME"),
                                              pIni.GetString(section, "DIRECTORY"),
                                              pIni.GetString(section, "EXTENSION"));
                            break;
                        }
                        section = "BUTTON" + ++i;
                    }
                }
            }

            ScrollButtons(0);
        }