コード例 #1
0
        public void PcLaunchDeep(string optionalTarget)
        {
            string output = "";
            // Get the tool listed on the startup page
            string command = "";            //;mParent.mainForm.StartupDeepTextBox.Text;

            if (command.IndexOf("[ProjectPath]") != -1)
            {
                command = string.Concat(command.Substring(0, command.IndexOf("[")), mainForm.mAssetManager.GetTargetPath(), command.Substring(command.IndexOf("]") + 1));
            }

            string target = optionalTarget;

            // Make sure the tool we need exits
            if (DosUtils.FileExist(command))
            {
                if (optionalTarget.Length != 0)
                {
                    guiCommandLine.ShellSpawn(command, target, ProcessWindowStyle.Normal, ref output);
                }
                else
                {
                    guiCommandLine.ShellSpawn(command);
                }
            }
            else
            {
                MOG_REPORT.ShowMessageBox("PC Tools", string.Concat("This tool is missing, have you updated to the latest version?"), MessageBoxButtons.OK);
            }
        }
コード例 #2
0
        public void AssetPopulate(MOG_Properties asset)
        {
            mProperties = asset;

            this.AssetDescriptionTextBox.Text = mProperties.GetDescription();
            this.AssetFormatTextBox.Text      = mProperties.GetGameDataPath();
            this.AssetRipperTextBox.Text      = mProperties.GetAssetRipper();
            this.AssetRipTaskerTextBox.Text   = mProperties.GetAssetRipTasker();
            this.AssetNameTextBox.Text        = mProperties.GetClassification();

            this.AssetIconTextBox.Text = mProperties.GetAssetIcon();
            if (DosUtils.FileExist(string.Concat(MOG_ControllerProject.GetProject().GetProjectToolsPath(), "\\", mProperties.GetAssetIcon())))
            {
                this.AssetIconPictureBox.Image = Image.FromFile(string.Concat(MOG_ControllerProject.GetProject().GetProjectToolsPath(), "\\", mProperties.GetAssetIcon()));
            }

            switch (mProperties.GetPackagedAsset().ToLower())
            {
            case "true":
                this.AssetPackageCheckBox.Checked = true;
                break;

            case "false":
                this.AssetPackageCheckBox.Checked = false;
                break;

            default:
                MessageBox.Show(this, "This asset has an invalid package value");
                break;
            }
        }
コード例 #3
0
        static private int LoadIcon(string imageFileName, string assetClassName)
        {
            try
            {
                // Load the icon specified by the Icon= key
                string iconName = imageFileName;

                // Make sure this is a full path, if not append the tools directory to it?
                iconName = MOG_ControllerSystem.LocateTool(imageFileName);

                lock (mAssetTypes)
                {
                    // Make sure that the icon file exists
                    if (iconName.Length > 0 && DosUtils.FileExist(iconName))
                    {
                        // Get the image
                        Image myImage = new Bitmap(iconName);

                        // Add the image and the type to the arrayLists
                        mAssetTypeImages.Images.Add(myImage);
                        mAssetTypes.Add(assetClassName, mAssetTypeImages.Images.Count - 1);

                        return(mAssetTypeImages.Images.Count - 1);
                    }
                }
            }
            catch (Exception e)
            {
                MOG_Report.ReportMessage("Load Icon", e.Message, e.StackTrace, MOG_ALERT_LEVEL.CRITICAL);
            }

            return(0);
        }
コード例 #4
0
        private int LoadIcon(string imageFileName, ImageList imageList)
        {
            try
            {
                if (imageFileName != null && imageFileName.Length > 0)
                {
                    // Load the icon specified by the Icon= key
                    string iconName = imageFileName;

                    // Make sure that the icon file exists
                    if (DosUtils.FileExist(iconName))
                    {
                        // Get the image
                        Image myImage = new Bitmap(iconName);

                        // Add the image and the type to the arrayLists
                        imageList.Images.Add(myImage);

                        return(imageList.Images.Count - 1);
                    }
                }
            }
            catch (Exception e)
            {
                MOG_Report.ReportMessage("Load Icon", e.Message, e.StackTrace, MOG_ALERT_LEVEL.CRITICAL);
            }

            return(0);
        }
コード例 #5
0
        private void PropertyNameWizardPage_ShowFromNext(object sender, EventArgs e)
        {
            // Always reset our tree
            TreeNode root = PropertyContextMenuTreeView.Nodes[0];

            root.Nodes.Clear();

            // We need to initialize any previously existing menu
            if (mProperties.PropertyMenu.Length != 0)
            {
                string PropertyMenuFullName = MOG_Tokens.GetFormattedString(mProperties.PropertyMenu, MOG_Tokens.GetProjectTokenSeeds(MOG_ControllerProject.GetProject()));

                // Make sure we got a filename with a full path, if we didn't it is probably a relational path
                if (!Path.IsPathRooted(PropertyMenuFullName))
                {
                    PropertyMenuFullName = MOG_ControllerProject.GetProject().GetProjectToolsPath() + "\\" + PropertyMenuFullName;
                }

                // Find and open the menu
                if (DosUtils.FileExist(PropertyMenuFullName))
                {
                    MOG_PropertiesIni ripMenu = new MOG_PropertiesIni(PropertyMenuFullName);
                    if (ripMenu.SectionExist("Property.Menu"))
                    {
                        string property = "";

                        // Create the sub menu
                        CreateChangePropertiesSubMenu(property, PropertyContextMenuTreeView.Nodes[0], "Property.Menu", ripMenu);
                    }
                }
            }
        }
コード例 #6
0
ファイル: MilestoneForm.cs プロジェクト: MOGwareSupport/MOG
        private void MilestoneTargetTextBox_TextChanged(object sender, System.EventArgs e)
        {
            // Check if any other patches exist
            string patchInfo = string.Concat(MilestoneTargetTextBox.Text, "\\MOG\\Patches\\Patches.Info");

            if (DosUtils.FileExist(patchInfo))
            {
                PatchNameComboBox.Items.Clear();

                // Open it and add it to our patch list
                MOG_Ini patches = new MOG_Ini(patchInfo);

                // Add a key for our local build first.
                PatchNameComboBox.Items.Add("Local");

                if (patches.SectionExist("PATCHES"))
                {
                    for (int i = 0; i < patches.CountKeys("PATCHES"); i++)
                    {
                        PatchNameComboBox.Items.Add(patches.GetKeyNameByIndex("PATCHES", i));
                    }
                }

                if (patches.SectionExist("Local") && patches.KeyExist("Local", "Current"))
                {
                    PatchNameComboBox.Text = patches.GetString("Local", "Current");
                }
                else
                {
                    PatchNameComboBox.Text = "Unknown";
                }
            }
        }
コード例 #7
0
        public void TargetXboxMakeIso()
        {
            // Optimize all the data
            string output    = "";
            string sourceDir = mainForm.mAssetManager.GetTargetPath();

            // Get the tool listed on the startup page
            string command = "[ProjectPath]\\Mog\\Tools\\Xbox\\Optimize\\Optimize.bat";

            if (command.IndexOf("[ProjectPath]") != -1)
            {
                command = string.Concat(command.Substring(0, command.IndexOf("[")), mainForm.mAssetManager.GetTargetPath(), command.Substring(command.IndexOf("]") + 1));
            }

            // Make sure the tool we need exits
            if (DosUtils.FileExist(command))
            {
                if (guiCommandLine.ShellExecute(command, mainForm.mAssetManager.GetTargetPath() + "\\System", ProcessWindowStyle.Normal, ref output) != 0)
                {
                    MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat(output), MessageBoxButtons.OK);
                }

                // Sync to the target xbox or folder
                TargetXboxSynch(false, false);
            }
            else
            {
                MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat("This tool is missing, have you updated to the latest version?"), MessageBoxButtons.OK);
            }
        }
コード例 #8
0
        static private int LoadIcon(string imageFileName, string assetClassName)
        {
            try
            {
                if (imageFileName != null && imageFileName.Length > 0)
                {
                    // Load the icon specified by the Icon= key
                    string iconName = imageFileName;

                    // Make sure this is a full path, if not append the tools directory to it?
                    iconName = MOG_ControllerSystem.LocateTool(imageFileName);

                    // Make sure that the icon file exists
                    if (iconName.Length > 0 && DosUtils.FileExist(iconName))
                    {
                        // Get the image
                        Image image = new Bitmap(iconName);

                        return(InternalAddIconToLists(assetClassName, iconName, image));
                    }
                }
            }
            catch (Exception e)
            {
                MOG_Report.ReportSilent("Load Icon", e.Message, e.StackTrace, MOG_ALERT_LEVEL.CRITICAL);
            }

            return(0);
        }
コード例 #9
0
        /// <summary>
        /// Post the build in the users data directory to their inbox
        /// <summary>
        public void BuildPost()
        {
            MOG_ControllerSyncData gameDataHandle = MOG_ControllerProject.GetCurrentSyncDataController();

            try
            {
                string ProjectName     = gameDataHandle.GetProjectName();
                string ProjectDir      = gameDataHandle.GetSyncDirectory();
                string ProjectPlatform = gameDataHandle.GetPlatformName();
                string ImportName      = string.Concat(MOG_ControllerProject.GetProjectName(), ".Build.Release.", ProjectName, ".", ProjectPlatform);
                string command         = string.Concat(MOG_ControllerProject.GetProject().GetProjectToolsPath(), "\\MOG_UserBless.bat");
                string output          = "";

                // Make sure the tool we need exits
                if (DosUtils.FileExist(command))
                {
                    guiCommandLine.ShellSpawn(command, string.Concat(ProjectName, " ", ProjectDir, " ", ProjectPlatform, " ", ImportName), ProcessWindowStyle.Normal, ref output);
                }
                else
                {
                    MOG_Prompt.PromptMessage("Tool", string.Concat("This tool(", command, ") is missing."), Environment.StackTrace);
                }
            }
            catch (Exception e)
            {
                MOG_Prompt.PromptMessage("Build Post", "Could not perform post due to error:\n\n" + e.Message, e.StackTrace);
            }
        }
コード例 #10
0
        private string InitializeSummaryMap()
        {
            // Summary filename
            string summaryFile = string.Concat(mSourcePath, "\\MOG\\platformSincSummary.", mMog.GetActivePlatform().mPlatformName, ".info");

            // Clear out the summary file if it exists
            if (DosUtils.FileExist(summaryFile))
            {
                if (!DosUtils.FileDelete(summaryFile))
                {
                    throw(new Exception("Could not delete summaryFile:" + summaryFile));
                }
            }

            string summaryPendingFile = summaryFile + "." + Path.GetFileNameWithoutExtension(mTargetConsole) + ".pending";

            if (DosUtils.FileExist(summaryPendingFile))
            {
                if (!DosUtils.FileDelete(summaryPendingFile))
                {
                    throw(new Exception("Could not delete summaryPendingFile:" + summaryPendingFile));
                }
            }

            mSummary     = new MOG_Ini(summaryFile);
            mPendingCopy = new MOG_Ini(summaryPendingFile);

            return(summaryFile);
        }
コード例 #11
0
        private bool CreateTargetDirectoryPath(string targetPath)
        {
            // Check for a sub-dir
            int index = targetPath.LastIndexOf("\\");

            if (index != -1 && targetPath[index - 1] != ':')
            {
                string RootDir = targetPath.Substring(0, index);
                if (!CreateTargetDirectoryPath(RootDir))
                {
                    return(false);
                }
            }

            if (mConsoleCopy)
            {
                // Check if it already exists
                if (!XboxUtils.FileExist(targetPath))
                {
                    //
                    if (!XboxUtils.DirectoryCreateVerify(targetPath, false))
                    {
                        // Error
                        MOG_REPORT.ShowMessageBox("Create Target Directory Path", string.Concat(RemapDirectoryString(targetPath), " could not be created!"), MessageBoxButtons.OK);
                        return(false);
                    }

                    XboxUtils.DM_FILE_ATTRIBUTES att = new XboxUtils.DM_FILE_ATTRIBUTES();
                    XboxUtils.GetFileAttributes(targetPath, ref att);
                    if (!(att.SizeHigh != 0 && att.SizeLow != 0))
                    {
                        // Error
                        MOG_REPORT.ShowMessageBox("Create Target Directory Path", string.Concat(RemapDirectoryString(targetPath), " could not be created!"), MessageBoxButtons.OK);
                        return(false);
                    }
                }
            }
            else
            {
                // Check if it already exists
                if (!DosUtils.FileExist(targetPath))
                {
                    //
                    try
                    {
                        Directory.CreateDirectory(targetPath);
                    }
                    catch (Exception e)
                    {
                        // Error
                        MOG_REPORT.ShowMessageBox("Create Directory Error", string.Concat(RemapDirectoryString(targetPath), " could not be created!", "\n", e.ToString()), MessageBoxButtons.OK);
                        return(false);
                    }
                }
            }

            return(true);
        }
コード例 #12
0
        public void Load(string section)
        {
            if (mSkinDef != null)
            {
                if (mSkinDef.SectionExist(section))
                {
                    ArrayList SkinNames = new ArrayList();
                    ArrayList Skins     = new ArrayList();

                    for (int i = 0; i < mSkinDef.CountKeys(section); i++)
                    {
                        string label        = mSkinDef.GetKeyNameByIndexSLOW(section, i);
                        string file         = mSkinDef.GetKeyByIndexSLOW(section, i);
                        string fullFilename = "";

                        if (Path.IsPathRooted(file))
                        {
                            fullFilename = file;
                        }
                        else
                        {
                            fullFilename = MOG.MOG_Main.GetExecutablePath() + "\\" + file;
                        }

LoadImage:

                        if (string.Compare(file, "none", true) != 0)
                        {
                            if (DosUtils.FileExist(fullFilename))
                            {
                                // Get the group image
                                Image myImage = new Bitmap(fullFilename);

                                // Add the image and the type to the arrayLists
                                Skins.Add(myImage);
                                SkinNames.Add(label);
                            }
                            else
                            {
                                switch (MOG_Prompt.PromptResponse("Custom skin", "Skin label:\n" + label + "\nSkin bitmap:\n" + fullFilename + "+\nCould not be found or is missing! This image will be nullified.", MOGPromptButtons.RetryCancel))
                                {
                                case MOGPromptResult.Retry:
                                    goto LoadImage;
                                }
                            }
                        }
                    }

                    mSections.Add(SkinNames);
                    mSectionNames.Add(section);
                    mSkins.Add(Skins);
                    mSkinNames.Add(SkinNames);
                }
            }
        }
コード例 #13
0
        /// <summary> InitializeAssetIcons
        /// Loads all the bmp's specified in the asset declarations
        /// in the Project.ini files.  Each bmp is added to a
        /// list allong with its key added to a corresponding list
        /// for later searching.
        /// </summary>
        static public void ClassIconInitialize()
        {
            // Check to see if our project is loaded
            if (!MOG_ControllerProject.IsProject())
            {
                return;
            }

            // Only allow population of the images array once
            if (mAssetTypes.Count > 0)
            {
                return;
            }

            lock (mAssetTypes)
            {
                // Add the active item icon first
                // Get the image
                if (DosUtils.FileExist(MOG_ControllerSystem.LocateTool("Images", "BaseNode.bmp")))
                {
                    // Get the group image
                    Image myImage = new Bitmap(MOG_ControllerSystem.LocateTool("Images", "BaseNode.bmp"));

                    // Add the image and the type to the arrayLists
                    mAssetTypeImages.Images.Add(myImage);
                    mAssetTypes.Add("dot");
                }

                if (DosUtils.FileExist(MOG_ControllerSystem.LocateTool("Images", "Group.bmp")))
                {
                    // Get the group image
                    Image myImage = new Bitmap(MOG_ControllerSystem.LocateTool("Images", "Group.bmp"));

                    // Add the image and the type to the arrayLists
                    mAssetTypeImages.Images.Add(myImage);
                    mAssetTypes.Add("group");
                }
            }

            mAssetTypeImages.TransparentColor = Color.Magenta;

            // Initialize state icons
            FileInfo [] stateImages = DosUtils.FileGetList(MOG_ControllerSystem.LocateTool("Images\\States", ""), "*.bmp");

            foreach (FileInfo stateImage in stateImages)
            {
                LoadRawIcon(mStateTypeImages, mStateTypes, stateImage.FullName, Path.GetFileNameWithoutExtension(stateImage.Name));
            }

            // Load our file icons as small icons
            mFileTypeManager = new IconListManager(mAssetTypeImages, IconReader.IconSize.Small);
        }
コード例 #14
0
        private bool InitializeFileCounts()
        {
            bool success = true;

            mGetFileCount     = true;
            mTotalFilesToCopy = 0;

            mProgress.DialogInitialize("(" + mTargetConsole + ")Platform Data Sync", "Calculating total files to be copied:\nThis may take a few seconds...", "");

            for (int i = 0; i < mPlatformSync.CountKeys("FileMap"); i++)
            {
                string sourcePath  = FormatString(mPlatformSync.GetKeyNameByIndex("FileMap", i).ToLower());
                string targetPath  = sourcePath.Replace(mSourcePath, mSyncRoot);
                string filePattern = mPlatformSync.GetKeyByIndex("FileMap", i).ToLower();
                success = SyncDirectories(sourcePath, filePattern, mSyncRoot);

                mProgress.DialogUpdate((i * 100) / mPlatformSync.CountKeys("FileMap"), "Scanning:\n" + targetPath);
                Application.DoEvents();

                // Create the needed directory on the xbox
                string newDirName = RemapDirectoryString(targetPath);
                if (mConsoleCopy)
                {
                    if (!XboxUtils.FileExist(newDirName))
                    {
                        mPendingCopy.PutSectionString("CREATE_DIR", newDirName);
                        mPendingCopy.Save();
                    }
                    else
                    {
                        mPendingCopy.PutSectionString("DIR_EXISTS", newDirName);
                        mPendingCopy.Save();
                    }
                }
                else
                {
                    if (!DosUtils.FileExist(newDirName))
                    {
                        mPendingCopy.PutSectionString("CREATE_DIR", newDirName);
                        mPendingCopy.Save();
                    }
                }

                // Check if the user has canceled
                if (!success)
                {
                    throw new Exception("User canceled the opperation");
                }
            }

            return(true);
        }
コード例 #15
0
        static private void LoadRawIcon(ImageList myImages, ArrayList myImageNames, string imageFileName, string imageName)
        {
            // Make sure that the icon file exists
            if (DosUtils.FileExist(imageFileName))
            {
                // Get the image
                Image myImage = new Bitmap(imageFileName);

                // Add the image and the type to the arrayLists
                myImages.Images.Add(myImage);
                myImageNames.Add(imageName.ToLower());
            }
        }
コード例 #16
0
        static private void LoadRawIcon(ImageList myImages, TstDictionary myImageNames, string imageFileName, string imageName)
        {
            // Make sure that the icon file exists
            if (DosUtils.FileExist(imageFileName))
            {
                // Get the image
                Image myImage = new Bitmap(imageFileName);

                // Add the image and the type to the arrayLists
                myImages.Images.Add(myImage);
                myImageNames.Add(imageName, myImages.Images.Count - 1);
                //Debug.WriteLine(imageName + ":" + (myImages.Images.Count - 1), "LoadIcon");
            }
        }
コード例 #17
0
        public void TargetXboxReset()
        {
            string  output         = "";
            string  sourceDir      = mainForm.mAssetManager.GetTargetPath();
            MOG_Ini buttonDefaults = null;

            if (mMog.IsProject())
            {
                // Get the project defaults
                string projectDefaultButtonsFile = mMog.GetProject().GetProjectToolsPath() + "\\" + mMog.GetProject().GetProjectName() + ".Client.Buttons.Default.info";
                if (DosUtils.FileExist(projectDefaultButtonsFile))
                {
                    buttonDefaults = new MOG_Ini(projectDefaultButtonsFile);
                }
            }

            // Get the tool listed on the startup page
            string command = "";

            if (buttonDefaults != null)
            {
                if (buttonDefaults.SectionExist(mMog.GetProject().GetProjectName() + ".Buttons"))
                {
                    if (buttonDefaults.KeyExist(mMog.GetProject().GetProjectName() + ".Buttons", "Reboot"))
                    {
                        command = buttonDefaults.GetString(mMog.GetProject().GetProjectName() + ".Buttons", "Reboot");
                    }
                }
            }

            if (command.IndexOf("[ProjectPath]") != -1)
            {
                command = string.Concat(command.Substring(0, command.IndexOf("[")), mainForm.mAssetManager.GetTargetPath(), command.Substring(command.IndexOf("]") + 1));
            }

            // Make sure the tool we need exits
            if (DosUtils.FileExist(command))
            {
                if (guiCommandLine.ShellExecute(command, string.Concat("/x ", mTargetXbox, " ", sourceDir), ProcessWindowStyle.Hidden, ref output) != 0)
                {
                    MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat(output), MessageBoxButtons.OK);
                }
            }
            else
            {
                MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat("This tool is missing, have you updated to the latest version?"), MessageBoxButtons.OK);
            }
        }
コード例 #18
0
        static private void LoadIcon(string imageFileName, string assetKey)
        {
            // Load the icon specified by the Icon= key
            string iconName = String.Concat(MOG_ControllerProject.GetProject().GetProjectToolsPath(), "\\", imageFileName);

            // Make sure that the icon file exists
            if (DosUtils.FileExist(iconName))
            {
                // Get the image
                Image myImage = new Bitmap(iconName);

                // Add the image and the type to the arrayLists
                mAssetTypeImages.Images.Add(myImage);
                mAssetTypes.Add(assetKey.ToLower());
            }
        }
コード例 #19
0
        /// <summary>
        /// Load the project defined custom buttons list
        /// </summary>
        public void Load()
        {
            if (mainForm.gMog.IsProject())
            {
                // Get the project defaults
                string projectDefaultButtonsFile = mainForm.gMog.GetProject().GetProjectToolsPath() + "\\" + mainForm.gMog.GetProject().GetProjectName() + ".Client.Buttons.Default.info";
                if (DosUtils.FileExist(projectDefaultButtonsFile))
                {
                    MOG_Ini defaults = new MOG_Ini(projectDefaultButtonsFile);
                    LoadButtons(defaults);
                }

                // Load the custom button configs
                LoadButtons(guiUserPrefs.ini);
            }
        }
コード例 #20
0
        public MogUtils_SkinManager(string skinDefinitionFile)
        {
            mSkins        = new ArrayList();
            mSkinNames    = new ArrayList();
            mSections     = new ArrayList();
            mSectionNames = new ArrayList();

            if (DosUtils.FileExist(skinDefinitionFile))
            {
                mSkinDef = new MOG_PropertiesIni(skinDefinitionFile);
            }
            else
            {
                ConstructDefaultSkin(skinDefinitionFile);
            }
        }
コード例 #21
0
        public RequestBuildForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            string buildTool = MOG_ControllerSystem.LocateTool("Configs", "Build.Options.Info");

            if (DosUtils.FileExist(buildTool))
            {
                mOptions = new MOG_Ini(buildTool);
                InitFormOptions();
            }

            // Load prefs
            PreloadLastSettings();
        }
コード例 #22
0
        private void LoadPlatformSinc()
        {
            string userSincFilename     = MOG_ControllerProject.GetUser().GetUserToolsPath() + "\\" + SyncUserMapComboBox.Text;
            string platformSincFilename = MOG_ControllerProject.GetProject().GetProjectToolsPath() + "\\" + SyncProjectMapComboBox.Text;

            // Open the project sync file
            MOG_Ini ProjectPlatfromSinc = null;

            if (DosUtils.FileExist(platformSincFilename))
            {
                ProjectPlatfromSinc = new MOG_Ini(platformSincFilename);
            }
            else
            {
                ProjectPlatfromSinc = null;
            }

            // Open user sync file
            MOG_Ini userPlatfromSinc = null;

            if (DosUtils.FileExist(userSincFilename))
            {
                userPlatfromSinc = new MOG_Ini(userSincFilename);
            }
            else
            {
                userPlatfromSinc = null;
            }

            // Populate the tree
            PopulateSyncTree(ProjectPlatfromSinc, userPlatfromSinc);


            // Close the ini's
            if (ProjectPlatfromSinc != null)
            {
                ProjectPlatfromSinc.CloseNoSave();
            }

            if (userPlatfromSinc != null)
            {
                userPlatfromSinc.CloseNoSave();
            }
        }
コード例 #23
0
        static public bool AddIcon(string directory, string filename, string key)
        {
            Tst.TstDictionaryEntry node = mAssetTypes.Find(key);
            if (node == null)
            {
                // Add the active item icon first
                // Get the image
                if (DosUtils.FileExist(MOG_ControllerSystem.LocateTool(directory, filename)))
                {
                    string iconName = MOG_ControllerSystem.LocateTool(directory, filename);
                    // Get the group image
                    Image myImage = new Bitmap(iconName);

                    InternalAddIconToLists(key, iconName, myImage);

                    return(true);
                }
            }
            return(false);
        }
コード例 #24
0
        public void Update()
        {
            if (DosUtils.FileExist(string.Concat(mMog.GetProject().GetProjectPath(), "\\Surveys\\Contents.info")))
            {
                MOG_Ini contentsInfo = new MOG_Ini(string.Concat(mMog.GetProject().GetProjectPath(), "\\Surveys\\Contents.info"));
                mainForm.SurveyListView.Items.Clear();

                for (int i = 0; i < contentsInfo.CountKeys("SURVEYS"); i++)
                {
                    string       SurveyName = contentsInfo.GetKeyNameByIndex("SURVEYS", i);
                    ListViewItem item       = new ListViewItem(contentsInfo.GetString(SurveyName, "Title"));
                    item.SubItems.Add(contentsInfo.GetString(SurveyName, "Time"));
                    item.SubItems.Add(contentsInfo.GetString(SurveyName, "Category"));
                    item.SubItems.Add(contentsInfo.GetString(SurveyName, "Status"));
                    item.SubItems.Add(contentsInfo.GetString(SurveyName, "Priority"));

                    mainForm.SurveyListView.Items.Add(item);
                }
            }
        }
コード例 #25
0
ファイル: ListForm.cs プロジェクト: MOGwareSupport/MOG
        /// <summary>
        /// Core export function that handles all the actual exporting
        /// </summary>
        private void ExportTo(EXPORTS format, ArrayList items)
        {
            List <object> args = new List <object>();

            args.Add(items);
            args.Add(format);

            // Init dialog window
            ProgressDialog progress = new ProgressDialog("Exporting Asset List to Excel", "Please wait while MOG exports the report...", ExportTo_Worker, args, true);

            if (progress.ShowDialog() == DialogResult.OK)
            {
                string filename = progress.WorkerResult as string;

                if (DosUtils.FileExist(filename))
                {
                    guiCommandLine.ShellSpawn(filename);
                }
            }
        }
コード例 #26
0
        /// <summary>
        /// Reset the button that was clicked on to the projects default state
        /// </summary>
        /// <param name="resetButton"></param>
        public void Reset(Button resetButton)
        {
            // Get the project defaults
            string projectDefaultButtonsFile = mainForm.gMog.GetProject().GetProjectToolsPath() + "\\" + mainForm.gMog.GetProject().GetProjectName() + ".Client.Buttons.Default.info";

            if (DosUtils.FileExist(projectDefaultButtonsFile))
            {
                MOG_Ini defaults = new MOG_Ini(projectDefaultButtonsFile);

                string projectName     = mainForm.gMog.GetProject().GetProjectName();
                string platformButtons = projectName + "." + mainForm.gMog.GetActivePlatform().mPlatformName + ".Buttons";

                string buttonKey = "Button" + GetButtonPrefsString(resetButton);

                if (defaults.KeyExist(platformButtons, buttonKey))
                {
                    string buttonName = "";
                    string buttonTool = "";

                    // Split the value of this key by the @ sign
                    string [] parts = defaults.GetString(platformButtons, buttonKey).Split("@".ToCharArray());
                    if (parts.Length >= 2)
                    {
                        buttonName = parts[0];
                        buttonTool = parts[1];
                    }
                    else if (parts.Length == 1)
                    {
                        buttonName = parts[0];
                    }

                    // Now assign the name and tool if it was defined
                    if (buttonName.Length != 0)
                    {
                        resetButton.Text = buttonName;
                        resetButton.Tag  = buttonTool;
                        Save();
                    }
                }
            }
        }
コード例 #27
0
        private void PopulateChangePropertiesToolsMenu(ContextMenu parent, string classification, MogMenuItem_Click method)
        {
            MenuItem menuRoot = null;

            // Find the change properties menuItem
            foreach (MenuItem item in parent.MenuItems)
            {
                if (MOG.StringUtils.StringCompare(item.Text, "Change Properties*"))
                {
                    menuRoot = item;
                    break;
                }
            }

            if (menuRoot != null)
            {
                // Check to see if there is a special menu options file
                string location = string.Concat(MOG_ControllerProject.GetProject().GetProjectToolsPath(), "\\ClassModifiers\\", classification, ".Menu");
                if (classification != "*" && DosUtils.FileExist(location))
                {
                    // Enable our menu
                    menuRoot.Enabled = true;
                    menuRoot.Text    = "Change Properties (" + classification + ")";

                    MOG_Ini specialMenuIni = new MOG_Ini(location);

                    if (specialMenuIni.SectionExist("ClassModifiers.GlobalMenu"))
                    {
                        // Clear the list
                        menuRoot.MenuItems.Clear();
                        PopulateChangePropertiesSubMenu(specialMenuIni, "ClassModifiers.GlobalMenu", menuRoot, method);
                    }
                }
                else
                {
                    menuRoot.Text    = "Change Properties (N/A)";
                    menuRoot.Enabled = false;
                }
            }
        }
コード例 #28
0
        private void InitializeDialog()
        {
            if (DosUtils.FileExist(mDialogInfoFilename))
            {
                MOG_Ini dialogInfo = new MOG_Ini(mDialogInfoFilename);

                // Init the controls
                if (dialogInfo.SectionExist("Controls"))
                {
                    int Y = 8;

                    for (int i = 0; i < dialogInfo.CountKeys("Controls"); i++)
                    {
                        string control        = dialogInfo.GetKeyNameByIndexSLOW("Controls", i);
                        string controlSection = dialogInfo.GetKeyByIndexSLOW("Controls", i);
                        switch (control.ToLower())
                        {
                        case "toggleoptions":
                            Y = CreateToggleCroupControl(Y, dialogInfo, controlSection);
                            break;

                        case "combooptions":
                            Y = CreateComboControls(Y, dialogInfo, controlSection);
                            break;

                        case "editoptions":
                            Y = CreateEditControls(Y, dialogInfo, controlSection);
                            break;
                        }
                    }

                    // Make sure our form is tall enough to handle the new controls
                    if (Height < Y)
                    {
                        Height = Y + 80;
                    }
                }
            }
        }
コード例 #29
0
        static public void ExplorerIconInitialize()
        {
            // Only allow population of the images array once
            if (mAssetTypes.Count > 0)
            {
                return;
            }

            lock (mAssetTypes)
            {
                // Add the active item icon first
                // Get the image
                if (DosUtils.FileExist(MOG_ControllerSystem.LocateTool("Images", "BaseNode.bmp")))
                {
                    // Get the group image
                    Image myImage = new Bitmap(MOG_ControllerSystem.LocateTool("Images", "BaseNode.bmp"));

                    // Add the image and the type to the arrayLists
                    mAssetTypeImages.Images.Add(myImage);
                    mAssetTypes.Add("dot");
                }

                if (DosUtils.FileExist(MOG_ControllerSystem.LocateTool("Images", "Group.bmp")))
                {
                    // Get the group image
                    Image myImage = new Bitmap(MOG_ControllerSystem.LocateTool("Images", "Group.bmp"));

                    // Add the image and the type to the arrayLists
                    mAssetTypeImages.Images.Add(myImage);
                    mAssetTypes.Add("group");
                }
            }

            mAssetTypeImages.TransparentColor = Color.Magenta;

            // Load our file icons as small icons
            mFileTypeManager = new IconListManager(mAssetTypeImages, IconReader.IconSize.Small);
        }
コード例 #30
0
        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));
                        }
                    }
                }
            }
        }