예제 #1
0
        public void SendSurvey(SurveyForm sfrm)
        {
            //MOG_SURVEY_PRIORITY priority;
            mtime = new MOG_Time();
            mtime.UpdateTime();

            //Controler stuff
            MOG_ControllerSurvey mController = new MOG_ControllerSurvey(mMog);

            mController.SetTitle(sfrm.SurveyNameTextBox.Text);
            mController.SetCategory(sfrm.SurveyCatComboBox.Text);
            mController.SetCreateTime(mtime.GetTimeStamp());
            mController.SetDescription(sfrm.SurveyDescTextBox.Text);

            // Set the priority
            MOG_SURVEY_PRIORITY priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_None;

            switch (sfrm.SurveyPriorityComboBox.Text)
            {
            case "None":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_None;
                break;

            case "Low":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_Low;
                break;

            case "Medium":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_Medium;
                break;

            case "High":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_High;
                break;

            case "Urgent":
                priority = MOG_SURVEY_PRIORITY.MOG_SURVEY_PRIORITY_Urgent;
                break;
            }
            mController.SetPriority(priority);

            //Figure out
            string users = "";

            mController.SetSurveyUsers(users);
            mController.SetCreator(mMog.GetUser().GetUserName());
            mController.SetExpireTime(sfrm.SurveyExpireDateTimePicker.Value.ToString());

            mController.Create();
            mController.Send();

            // Update the surveys window
            Update();
        }
        private void InitializeXboxList()
        {
            if (mMog.IsUser())
            {
                // Get the project ini
                MOG_Ini configFile = new MOG_Ini(mMog.GetProject().GetProjectConfigFilename());

                // Clear our target combo box
                mainForm.AssetManagerLocalDataXboxTargetComboBox.Items.Clear();

                // Add each target to the combo box
                if (configFile.SectionExist("Xboxes"))
                {
                    for (int x = 0; x < configFile.CountKeys("Xboxes"); x++)
                    {
                        mainForm.AssetManagerLocalDataXboxTargetComboBox.Items.Add(configFile.GetKeyNameByIndex("Xboxes", x));
                    }
                }

                // Check for a user defined console list
                string userPath       = mMog.GetUser().GetUserToolsPath();
                string consoleIniFile = string.Concat(userPath, "\\consoles.ini");

                if (DosUtils.FileExist(consoleIniFile))
                {
                    MOG_Ini userConsoleIni = new MOG_Ini(consoleIniFile);

                    // Add each target to the combo box
                    if (userConsoleIni.SectionExist("Xboxes"))
                    {
                        for (int x = 0; x < userConsoleIni.CountKeys("Xboxes"); x++)
                        {
                            mainForm.AssetManagerLocalDataXboxTargetComboBox.Items.Add(userConsoleIni.GetKeyNameByIndex("Xboxes", x));
                        }
                    }
                }
            }
        }
예제 #3
0
        private bool InitializeFileMap()
        {
            mPlatformSync = new MOG_Ini();

            // Get the platformSinc.info file
            string platformSyncFile = mMog.GetProject().GetProjectToolsPath() + "\\" + mProjectSyncFile;

            if (DosUtils.Exist(platformSyncFile))
            {
                // Open the global sinc file to determine what to sinc
                mPlatformSync.Open(platformSyncFile, FileShare.Read);
                mPlatformSync.SetFilename(mMog.GetUser().GetUserToolsPath() + "\\platformSinc." + mMog.GetActivePlatform().mPlatformName + ".Merge.info", false);
            }

            // Check if the user has a custom sync file
            string userSyncFile = mMog.GetUser().GetUserToolsPath() + "\\" + mUserSyncFile;

            if (DosUtils.FileExist(userSyncFile))
            {
                // Should we force ourselves to use only the user sync file?
                if (string.Compare(mProjectSyncFile, "none", true) == 0)
                {
                    mPlatformSync.CloseNoSave();
                    mPlatformSync.Open(userSyncFile, FileShare.Read);
                }
                else
                {
                    // Lets merge the two then
                    mPlatformSync.PutFile(userSyncFile);
                }
            }

            // Make sure we got 'a' Map file loaded
            if (mPlatformSync.GetFilename().Length > 0)
            {
                // Is this a local sync
                if (Path.IsPathRooted(mTargetConsole))
                {
                    string root = "";
                    // Get our local directory root path
                    // Get our console root path
                    if (mUseDefaultUser)
                    {
                        root = FormatString(mPlatformSync.GetString(mMog.GetActivePlatform().mPlatformName, "SpecialRoot").ToLower());
                    }
                    else
                    {
                        root = FormatString(mPlatformSync.GetString(mMog.GetActivePlatform().mPlatformName, "Root").ToLower());
                    }

                    // Fix up the pc console name
                    mSyncRoot    = mTargetConsole + "\\" + Path.GetFileNameWithoutExtension(root);
                    mConsoleCopy = false;
                }
                else
                {
                    // Get our console root path
                    if (mUseDefaultUser)
                    {
                        mSyncRoot = FormatString(mPlatformSync.GetString(mMog.GetActivePlatform().mPlatformName, "SpecialRoot").ToLower());
                    }
                    else
                    {
                        mSyncRoot = FormatString(mPlatformSync.GetString(mMog.GetActivePlatform().mPlatformName, "Root").ToLower());
                    }
                }
            }
            else
            {
                throw(new Exception("Valid platform sync file never properly loaded!"));
            }

            return(true);
        }