Esempio n. 1
0
        private bool InitializeTargetDirectory()
        {
            if (mConsoleCopy)
            {
                if (!XboxUtils.FileExist(mSyncRoot))
                {
                    if (!XboxUtils.DirectoryCreateVerify(mSyncRoot, true))
                    {
                        // Error
                        //MOG_REPORT.ShowMessageBox("Xbox Dir Error", string.Concat(mSyncRoot, " could not be created!"), MessageBoxButtons.OK);
                        throw new Exception(mSyncRoot + " could not be created!");
                    }
                }
            }
            else
            {
                // Create the initial directory on the pc
                if (!DosUtils.Exist(mSyncRoot))
                {
                    try
                    {
                        Directory.CreateDirectory(mSyncRoot);
                    }
                    catch (Exception e)
                    {
                        // Error
                        MOG_REPORT.ShowMessageBox("Dir Error", string.Concat(mSyncRoot, " could not be created!", "\n", e.ToString()), MessageBoxButtons.OK);
                        throw new Exception(mSyncRoot + " could not be created!", e);
                        //return false;
                    }
                }
            }

            return(true);
        }
        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);
            }
        }
Esempio n. 3
0
        private void MogProcess()
        {
            while (!MOG_Main.isShutdown())
            {
                try
                {
                    MOG_Main.Process();
                }
                catch (Exception ex)
                {
                    MOG_Command pNotify = new MOG_Command();
                    pNotify.Setup_NotifySystemException("MogProcess:Exception Error durring Mog.Process" + "\n\nMessage: " + ex.ToString() + "\n\nStackTrace:" + ex.StackTrace.ToString());
                    MOG_ControllerSystem.GetCommandManager().CommandProcess(pNotify);

                    MOG_REPORT.LogError("MogProcess", "Exception Error durring Mog.Process");
                    MOG_REPORT.LogError("MogProcess", ex.ToString());
                    MOG_REPORT.LogError("MogProcess", ex.StackTrace.ToString());
                }

                Thread.Sleep(100);
            }

            Application.Exit();
            mMogProcess.Abort();
            mMogProcess = null;
        }
Esempio n. 4
0
        private void InitializeSourceVersions()
        {
            MilestoneSourceComboBox.Items.Clear();

            // Add the local version first
            string platform = MilestonePlatformComboBox.Text;

            if (mMog.GetProject().GetPlatform(platform) != null)
            {
                MilestoneSourceComboBox.Items.Add(string.Concat(mMog.GetProject().GetPlatform(platform).mPlatformTargetPath, "\\MOG\\LocalVersion.info"));
            }
            else if (string.Compare(platform, "All", true) == 0)
            {
                // error out for now
                MOG_REPORT.ShowMessageBox("ERROR", "All platform not supported yet.", MessageBoxButtons.OK);
            }

            // Add the global current version next
            string globalPath = string.Concat(mMog.GetProject().GetProjectPath(), "\\Versions\\");

            MilestoneSourceComboBox.Items.Add(string.Concat(globalPath, "Current.info"));

            foreach (FileInfo file in DosUtils.FileGetList(globalPath, "*.info"))
            {
                if (string.Compare(file.Name, "Current.info", true) != 0)
                {
                    MilestoneSourceComboBox.Items.Add(string.Concat(globalPath, file.Name));
                }
            }
        }
        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);
            }
        }
Esempio n. 6
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);
        }
Esempio n. 7
0
        private bool RemapString(string source, ref string targetFile)
        {
            string remapName;

            source = source.ToLower();

            // Default remap
            targetFile = source.Replace(mSourcePath, mSyncRoot);

            // Check for special rules for this asset in the ReMap section
            if (mPlatformSync.SectionExist("ReMap"))
            {
                for (int x = 0; x < mPlatformSync.CountKeys("ReMap"); x++)
                {
                    remapName = FormatString(mPlatformSync.GetKeyNameByIndex("ReMap", x).ToLower());

                    //Strip the files of their roots
                    //string remapNameNoRoot = remapName.Replace(mSourcePath, "");
                    //string sourceNoRoot = source.Replace(mSourcePath, "");

                    //if (StringUtils.StringCompare(remapNameNoRoot, sourceNoRoot))
                    if (StringUtils.StringCompare(remapName, source))
                    {
                        string wildString = "";

                        // Check for wildcards
                        if (remapName.IndexOf("*") != -1)
                        {
                            // Make sure we only have one *
                            if (remapName.IndexOf("*", remapName.IndexOf("*") + 1) != -1)
                            {
                                // Error!
                                MOG_REPORT.ShowMessageBox(mPlatformSync.GetFilename(), string.Concat("There are more than one '*' in string(", remapName, ")!  This is not allowed!"), MessageBoxButtons.OK);
                                return(false);
                            }
                            else
                            {
                                // If we have a wildcard, replace all target * with the text from the source *
                                wildString = FindWildcardString(source, remapName);
                            }
                        }

                        targetFile = mPlatformSync.GetKeyByIndex("Remap", x).ToLower();
                        targetFile = FormatString(targetFile);

                        // replace * if we had a wildCard
                        if (wildString.Length != 0)
                        {
                            targetFile = targetFile.Replace("*", wildString);
                        }

                        break;
                    }
                }
            }

            return(true);
        }
        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);
            }
        }
Esempio n. 9
0
        private bool SyncDirectories(string fullFilename, string filePattern, string targetString)
        {
            // Copy Files

            // Make sure our target directory exists.
CheckDirectory:
            if (!DosUtils.DirectoryExist(fullFilename))
            {
                //Error
                switch (MOG_REPORT.ShowMessageBox("Platform Sync", "Attempted to sync (" + fullFilename + ") but could not find it! \n What should we do?", MessageBoxButtons.AbortRetryIgnore))
                {
                case DialogResult.Ignore:
                    break;

                case DialogResult.Retry:
                    goto CheckDirectory;

                case DialogResult.Abort:
                    return(false);
                }
            }

            // Walk all the directories
            DirectoryInfo[] dirs = DosUtils.DirectoryGetList(fullFilename, "*.*");
            if (dirs != null && dirs.Length > 0)
            {
                foreach (DirectoryInfo dir in dirs)
                {
                    string targetDirectory = dir.FullName.ToLower().Replace(mSourcePath, mSyncRoot);

                    // Copy the files in this directory
                    if (!SyncDirectories(dir.FullName, filePattern, targetDirectory))
                    {
                        return(false);
                    }
                }

                // Now do the files in this directory
                return(SyncFiles(fullFilename, filePattern));
            }
            else
            {
                return(SyncFiles(fullFilename, filePattern));
            }
        }
Esempio n. 10
0
        private string FindWildcardString(string source, string targetSource)
        {
            string result     = "";
            bool   inWildcard = false;
            int    c          = 0;

            CharEnumerator ch = targetSource.ToLower().GetEnumerator();

            // Itterate through the target string looking for the *
            while (ch.MoveNext())
            {
                // When we find it, set our state to be the 'inWildcard' state
                if (ch.Current == '*')
                {
                    inWildcard = true;
                }
                else
                {
                    if (inWildcard)
                    {
                        // Now, loop through all the chars of the source till we find a character that is no longer = to the target
                        while (ch.Current != source[c])
                        {
                            // Append each character found to find out what would go inplace of the *
                            // I.e. Animations\xbox_adventinterface.ukx
                            //      Animations\xbox_*.ukx
                            //      = adventinterface
                            result = string.Concat(result, source[c++]);
                            if (c > source.Length)
                            {
                                // Error!
                                MOG_REPORT.ShowMessageBox("guiPlatformSync::FindWildcardString(string, string)", string.Concat("Source (", source, ") ran out of characters looking for match from (", targetSource, ")!"), MessageBoxButtons.OK);
                                return("");
                            }
                        }
                        return(result.ToLower());
                    }
                    else
                    {
                        c++;
                    }
                }
            }
            return(result.ToLower());
        }
Esempio n. 11
0
        private void MOG_ExportAllButton_Click(object sender, System.EventArgs e)
        {
            if (string.Compare(this.PhotoshopLabel.Text, "P.S. V.9") == 0)
            {
                try
                {
                    ps.ApplicationClass app     = new ps.ApplicationClass();
                    ps.Documents        doc_arr = app.Documents;
                    foreach (ps.Document doc in doc_arr)
                    {
                        ps.PhotoshopSaveOptionsClass psSaveOptions = new ps.PhotoshopSaveOptionsClass();
                        psSaveOptions.AlphaChannels = true;
                        psSaveOptions.Annotations   = true;
                        psSaveOptions.Layers        = true;
                        psSaveOptions.SpotColors    = true;

                        string FullFilename = mTargetDir + "\\" + doc.Name;

                        doc.SaveAs(FullFilename, psSaveOptions, true, ps.PsExtensionType.psUppercase);
                    }
                }
                catch (Exception ex)
                {
                    MOG_REPORT.ShowErrorMessageBox("Photoshop CS import", "Could not initialize a compatible link between MOG and your version of Photoshop\nMessage:" + ex.ToString());
                    return;
                }
            }
            else if (string.Compare(this.PhotoshopLabel.Text, "P.S. V.7") == 0)
            {
                try
                {
                    MOG_Export export = new MOG_Export();

                    export.LaunchExportAll(mTargetDir);
                }
                catch (Exception ex)
                {
                    MOG_REPORT.ShowErrorMessageBox("Photoshop 7 import", "Could not initialize a compatible link between MOG and your version of Photoshop\nMessage:" + ex.ToString());
                    return;
                }
            }
        }
Esempio n. 12
0
        public void Add()
        {
            // Find the first non-visible button in the valid buttons array and make it visible
            foreach (guiPlatformButtonHandles platformButton in PlatformButtonHandles)
            {
                if (string.Compare(platformButton.mPlatform, mainForm.gMog.GetActivePlatform().mPlatformName, true) == 0)
                {
                    foreach (Button button in platformButton.mButtonHandles)
                    {
                        if (button.Visible == false)
                        {
                            button.Visible = true;
                            Save();
                            return;
                        }
                    }
                }
            }

            MOG_REPORT.ShowMessageBox("Add Custom tool button", "There are no more buttons available", MessageBoxButtons.OK);
        }
Esempio n. 13
0
        public void DisplayDeleteConnectionsByID(int id)
        {
            ListViewItem foundItem = null;

            foreach (ListViewItem item in mForm.lviewMonitor.Items)
            {
                Int32 ID = Convert.ToInt32(item.SubItems[2].Text);

                if (id == ID)
                {
                    foundItem = item;
                    break;
                }
            }

            if (foundItem != null)
            {
                mForm.lviewMonitor.Items.Remove(foundItem);
            }

            MOG_REPORT.ReportComment("deleted a computer");
        }
        public void MessageEdit()
        {
            MessageForm newMessage = new MessageForm(mParent.mainForm);

            ListView box;

            // Get the correct box
            if (String.Compare(mParent.mainForm.AssetManagerBoxesTabControl.SelectedTab.Name, "AssetManagerInboxTabPage", true) == 0)
            {
                box = mParent.mainForm.AssetManagerInboxMessagesListViewFilter;
            }

            else if (String.Compare(mParent.mainForm.AssetManagerBoxesTabControl.SelectedTab.Name, "AssetManagerOutboxTabPage", true) == 0)
            {
                box = mParent.mainForm.AssetManagerOutboxMessagesListViewFilter;
            }
            else
            {
                box = null;
                return;
            }

            // We can only edit one message no more or less
            if (box.SelectedItems.Count == 1)
            {
                foreach (ListViewItem item in box.SelectedItems)
                {
                    newMessage.Open(item);
                    newMessage.Show();
                    return;
                }
            }
            else
            {
                MOG_REPORT.ShowMessageBox("Edit message", "You can only edit one message at a time.", MessageBoxButtons.OK);
                return;
            }
        }
Esempio n. 15
0
        public void Remove(Button removeButton)
        {
            // Find the first non-visible button in the valid buttons array and make it visible
            foreach (guiPlatformButtonHandles platformButton in PlatformButtonHandles)
            {
                if (string.Compare(platformButton.mPlatform, mainForm.gMog.GetActivePlatform().mPlatformName, true) == 0)
                {
                    foreach (Button button in platformButton.mButtonHandles)
                    {
                        if (button == removeButton)
                        {
                            button.Text    = "n/a";
                            button.Tag     = null;
                            button.Visible = false;
                            Save();
                            return;
                        }
                    }
                }
            }

            MOG_REPORT.ShowMessageBox("Remove Custom tool button", "We were able to remove this button", MessageBoxButtons.OK);
        }
Esempio n. 16
0
        /// <summary>
        /// Lauch the desired command associated with this button
        /// </summary>
        /// <param name="button"></param>
        public void Click(Button button)
        {
            // Early out if there is no command specified
            if (button.Tag == null)
            {
                return;
            }

            string commandSource = ((string)button.Tag).ToLower();
            string output        = "";
            string command       = "";
            string arguments     = "";

            // Make sure this is not a system command
            if (string.Compare(commandSource, "system", true) == 0)
            {
                // Determine if this command is within our system defined keywords
                switch (button.Text.ToLower())
                {
                case "sync":
                    // Launch Sync code
                    mainForm.mAssetManager.mTools.TargetXboxSynch(false, false);
                    break;

                case "run":
                    if (string.Compare(mainForm.gMog.GetActivePlatform().mPlatformName, "xbox", true) == 0)
                    {
                        mainForm.mAssetManager.mTools.TargetXboxRun();
                    }
                    else
                    {
                        MOG_REPORT.ShowMessageBox("Launch Tool", "System command for button:" + button.Text + " not found!", MessageBoxButtons.OK);
                        return;
                    }
                    break;

                case "sync remove":
                    mainForm.mAssetManager.mTools.TargetXboxDeepSynch();
                    break;

                case "screenshot":
                    // Launch Sync code
                    mainForm.mAssetManager.mTools.TargetXboxCapture();
                    break;

                case "make iso":
                    mainForm.mAssetManager.mTools.TargetXboxMakeIso();
                    break;

                case "full make iso":
                    mainForm.mAssetManager.BuildMerge(true);
                    mainForm.mAssetManager.mTools.TargetXboxMakeIso();
                    break;

                case "make linear iso":
                    mainForm.mAssetManager.BuildMerge(true);
                    mainForm.mAssetManager.mTools.TargetXboxMakeLinearLoadIso();
                    break;

                default:
                    MOG_REPORT.ShowMessageBox("Launch Tool", "System command for button:" + button.Text + " not found!", MessageBoxButtons.OK);
                    return;
                }
            }
            else
            {
                // Break the command into two strings.  One for the exe and the other for arguments
                CreateCommandAndArguments(commandSource, ref command, ref arguments);

                // Make sure the exe exists
                if (DosUtils.FileExist(command))
                {
                    // Spawn the app or tool
                    if (guiCommandLine.ShellSpawn(command, arguments, ProcessWindowStyle.Normal, ref output) != 0)
                    {
                        // Report an error if the tool did not return 0
//						MOG_REPORT.ShowMessageBox("Launch Exe", string.Concat(output), MessageBoxButtons.OK);
                    }
                }
                else
                {
                    MOG_REPORT.ShowMessageBox("Launch Exe", string.Concat("File: ", command, ", does not exist"), MessageBoxButtons.OK);
                }
            }
        }
        public void TargetXboxMakeLinearLoadIso()
        {
            // Optimize all the data
            string output    = "";
            string sourceDir = mainForm.mAssetManager.GetTargetPath();

            string userName   = mMog.GetUser().GetUserName();
            bool   useDefault = false;

            CallbackDialogForm bigProgress = new CallbackDialogForm();

            bigProgress.DialogInitialize("Make Linear Load Build", "Creating linear maps...\nThis could take many hours", "Cancel");

            // Use 'default' as user, if the Default checkbox is checked.  This is used for the programmers who debug their code using the default.xbe
            if (mainForm.AssetManagerLocalDataXboxDefaultCheckBox.Checked)
            {
                userName   = "******";
                useDefault = true;
            }

            // Check for user cancel
            Application.DoEvents();
            if (bigProgress.DialogProcess())
            {
                bigProgress.DialogKill();
                return;
            }

            // 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));
            }

            bigProgress.DialogUpdate(10, "Optimizing the newly merged data");

            // Make sure the tool we need exits
            if (DosUtils.FileExist(command))
            {
                // Check for user cancel
                Application.DoEvents();
                if (bigProgress.DialogProcess())
                {
                    bigProgress.DialogKill();
                    return;
                }

                if (guiCommandLine.ShellExecute(command, mainForm.mAssetManager.GetTargetPath() + "\\System", ProcessWindowStyle.Normal, ref output) != 0)
                {
                    MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat(output), MessageBoxButtons.OK);
                }

                // Check for user cancel
                Application.DoEvents();
                if (bigProgress.DialogProcess())
                {
                    bigProgress.DialogKill();
                    return;
                }

                bigProgress.DialogUpdate(20, "Syncing to Build Xbox for linear load tool execution...");

                // Sync to the Linear Build xbox
                string buildXbox = "LinearBuild";

                // Logon to correct xbox
                XboxUtils.SetXboxName(buildXbox, false);

                guiPlatformSinc sinc = new guiPlatformSinc(buildXbox, mainForm.mAssetManager.GetTargetPath(), mainForm, userName, useDefault, false, false, false);
                sinc.mProjectSyncFile = "xbox.opt.ls.sync";
                sinc.mUserSyncFile    = "";
                sinc.TargetConsoleSync();

                // Check for user cancel
                Application.DoEvents();
                if (bigProgress.DialogProcess())
                {
                    bigProgress.DialogKill();
                    return;
                }

                // Run the linear load tool
                string xboxExe = "xE:\\" + mMog.GetProject().GetProjectName() + "\\defaultls.xbe";

                bigProgress.DialogUpdate(30, "Preparing for linear load tool execution...");

                // Kill the Linear load complete file in the root before we call the tool
                if (XboxUtils.FileExist("xQ:\\LoadComplete.sys"))
                {
                    XboxUtils.FileDelete("xQ:\\LoadComplete.sys");
                }

                // Check for user cancel
                Application.DoEvents();
                if (bigProgress.DialogProcess())
                {
                    bigProgress.DialogKill();
                    return;
                }


                // Kill all previous linear files
                string LinearLoadFiles = XboxUtils.GetFiles("xE:\\" + mMog.GetProject().GetProjectName() + "\\System\\");
                if (LinearLoadFiles.Length != 0 && LinearLoadFiles.IndexOf(",") != -1)
                {
                    CallbackDialogForm progress1 = new CallbackDialogForm();
                    progress1.DialogInitialize("Make Linear Load Build", "Deleting previous linear load maps...", "Cancel");

                    string [] files = LinearLoadFiles.Split(",".ToCharArray());
                    foreach (string file in files)
                    {
                        if (string.Compare(Path.GetExtension(file), ".lin", true) == 0)
                        {
                            progress1.DialogUpdate(0, file);
                            XboxUtils.FileDelete(file);

                            // Check for user cancel
                            Application.DoEvents();
                            if (bigProgress.DialogProcess())
                            {
                                progress1.DialogKill();
                                bigProgress.DialogKill();
                                return;
                            }

                            if (progress1.DialogProcess())
                            {
                                progress1.DialogKill();
                                return;
                            }
                        }
                    }

                    progress1.DialogKill();
                }

                // Check for user cancel
                Application.DoEvents();
                if (bigProgress.DialogProcess())
                {
                    bigProgress.DialogKill();
                    return;
                }

                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
                if (buttonDefaults != null)
                {
                    if (buttonDefaults.SectionExist(mMog.GetProject().GetProjectName() + ".Buttons"))
                    {
                        if (buttonDefaults.KeyExist(mMog.GetProject().GetProjectName() + ".Buttons", "Run"))
                        {
                            command = buttonDefaults.GetString(mMog.GetProject().GetProjectName() + ".Buttons", "Run");
                        }
                    }
                }

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

                // Check for user cancel
                Application.DoEvents();
                if (bigProgress.DialogProcess())
                {
                    bigProgress.DialogKill();
                    return;
                }

                bigProgress.DialogUpdate(50, "Starting the linear load creation tool...");

                // Make sure the tool we need exits
                if (DosUtils.FileExist(command))
                {
                    if (guiCommandLine.ShellExecute(command, string.Concat("/x ", buildXbox, " ", xboxExe), ProcessWindowStyle.Hidden, ref output) != 0)
                    {
                        MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat(output), MessageBoxButtons.OK);
                    }

                    // Wait till the LinearLoad.sys file exists before continuing...
                    while (XboxUtils.FileExist("Q:\\LoadComplete.sys") == false)
                    {
                        Application.DoEvents();
                        if (bigProgress.DialogProcess())
                        {
                            bigProgress.DialogKill();
                            return;
                        }

                        Thread.Sleep(500);
                    }
                }
                else
                {
                    MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat("This tool is missing, have you updated to the latest version?"), MessageBoxButtons.OK);
                }

                // Kill the Linear load complete file once we are done
                if (XboxUtils.FileExist("xQ:\\LoadComplete.sys"))
                {
                    XboxUtils.FileDelete("xQ:\\LoadComplete.sys");
                }

                // Check for user cancel
                Application.DoEvents();
                if (bigProgress.DialogProcess())
                {
                    bigProgress.DialogKill();
                    return;
                }

                bigProgress.DialogUpdate(80, "Retrieving linear load maps from Build Xbox...");

                // Copy off the data
                LinearLoadFiles = XboxUtils.GetFiles("xE:\\" + mMog.GetProject().GetProjectName() + "\\System\\");

                if (LinearLoadFiles.Length != 0 && LinearLoadFiles.IndexOf(",") != -1)
                {
                    CallbackDialogForm progress = new CallbackDialogForm();
                    progress.DialogInitialize("Make Linear Load Build", "Copying completed linear load maps...", "Cancel");

                    string [] files = LinearLoadFiles.Split(",".ToCharArray());
                    foreach (string file in files)
                    {
                        if (string.Compare(Path.GetExtension(file), ".lin", true) == 0)
                        {
                            string target = mMog.GetActivePlatform().mPlatformTargetPath + "\\xboxdata\\maps\\" + Path.GetFileName(file);

                            progress.DialogUpdate(0, target);

                            // Check for user cancel
                            Application.DoEvents();
                            if (bigProgress.DialogProcess())
                            {
                                progress.DialogKill();
                                bigProgress.DialogKill();
                                return;
                            }

                            if (progress.DialogProcess())
                            {
                                progress.DialogKill();
                                break;
                            }

                            if (!XboxUtils.FileGet(file, target, false))
                            {
                                MOG_REPORT.ShowMessageBox("Make Linear Load Build", "Error copying file(" + file + ") from build xbox!", MessageBoxButtons.OK);
                            }
                        }
                    }

                    progress.DialogKill();
                }
                else
                {
                    MOG_REPORT.ShowMessageBox("Make Linear Load Build", "There were no Linear Load files found on the Xbox Build machine(" + buildXbox + ")", MessageBoxButtons.OK);
                    return;
                }


                // Check for user cancel
                Application.DoEvents();
                if (bigProgress.DialogProcess())
                {
                    bigProgress.DialogKill();
                    return;
                }

                bigProgress.DialogUpdate(90, "Syncing to target Xbox...");

                // Sync
                sinc = new guiPlatformSinc(mTargetXbox, mainForm.mAssetManager.GetTargetPath(), mainForm, userName, useDefault, false, false, false);
                sinc.mProjectSyncFile = "xbox.opt.ll.sync";
                sinc.mUserSyncFile    = "";
                sinc.TargetConsoleSync();
            }
            else
            {
                MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat("This tool is missing, have you updated to the latest version?"), MessageBoxButtons.OK);
            }

            bigProgress.DialogUpdate(100, "Done!");
            bigProgress.DialogKill();
        }
Esempio n. 18
0
        public void TargetConsoleRemoveSync()
        {
            // Build a list of exactly what should be on the xbox
            mGetFileCount     = true;
            mTotalFilesToCopy = 0;
            bool success = true;

            string CopyFileMap = mSourcePath + "\\MOG\\platformSincMap." + mMog.GetActivePlatform().mPlatformName + ".info";

            if (DosUtils.FileExist(CopyFileMap))
            {
                if (!DosUtils.FileDelete(CopyFileMap))
                {
                    return;
                }
            }

            // Create the new map
            mPendingCopy = new MOG_Ini(CopyFileMap);

            InitializeFileMap();
            mFileMapCreate = true;

            // Initialize our progress dialog
            mProgress = new CallbackDialogForm();
            string message = "Preforming platform remove data Sync: \n" +
                             "   Project Sync file map:" + mProjectSyncFile + "\n" +
                             "   User Sync file map:" + mUserSyncFile + "\n";

            mProgress.DialogInitialize("(" + mTargetConsole + ")Platform Remove Data Sync", message, "");
            Application.DoEvents();

            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"), sourcePath + "\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
                {
                    if (!DosUtils.FileExist(newDirName))
                    {
                        mPendingCopy.PutSectionString("CREATE_DIR", newDirName);
                        mPendingCopy.Save();
                    }
                }
            }

            if (mConsoleCopy)
            {
                // Logon to correct xbox
                XboxUtils.SetXboxName(mTargetConsole, false);
            }

            mProgress.DialogInitialize("Sync Remove", "Scanning console for non-needed assets", "");

            ArrayList deletableAssets = new ArrayList();

            // Verify the xbox for each of these files
            for (int j = 0; j < mPlatformSync.CountKeys("FileMap"); j++)
            {
                string sourcePath = FormatString(mPlatformSync.GetKeyNameByIndex("FileMap", j).ToLower());
                string targetPath = sourcePath.Replace(mSourcePath, mSyncRoot);
                string walkFiles  = XboxUtils.GetFiles(targetPath + "\\");

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

                if (walkFiles.Length != 0 && walkFiles.IndexOf(",") != -1)
                {
                    string [] files = walkFiles.Split(",".ToCharArray());
                    for (int k = 0; k < files.Length; k++)
                    {
                        string targetFile = files[k];

                        if (Path.GetExtension(targetFile) != "")
                        {
                            // Check to see if this file exists in the map
                            if (!mPendingCopy.KeyExist("MAP", targetFile))
                            {
                                // Get the list of deletable assets
                                deletableAssets.Add(targetFile);
                            }
                        }
                    }
                }
            }

            mProgress.DialogKill();
            mProgress = null;

            if (deletableAssets.Count != 0)
            {
                if (guiConfirmDialog.MessageBoxDialog("Console Remove Sync", "Is is OK to Delete the Following Assets?", deletableAssets, MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    // Delete the assets in the list from off the xbox
                    foreach (string str in guiConfirmDialog.SelectedItems)
                    {
                        string [] parts = str.Split(",;".ToCharArray());
                        if (parts != null && parts.Length >= 2)
                        {
                            string assetDeleteName = parts[0];
                            XboxUtils.FileDelete(assetDeleteName);
                        }
                    }
                }
            }
            else
            {
                MOG_REPORT.ShowMessageBox("Sync Remove", "This target does not have any files that need to be deleted", MessageBoxButtons.OK);
            }
        }
        public void TargetXboxCapture()
        {
            string  output         = "";
            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", "Capture"))
                    {
                        command = buttonDefaults.GetString(mMog.GetProject().GetProjectName() + ".Buttons", "Capture");
                    }
                }
            }

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

            // Create a screenshot name
            string path = "";

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

            string screenShotName = string.Concat(path, "\\", mMog.GetProject().GetProjectName(), new MOG_Time().FormatString("{month.2}{day.2}{year.2}{hour.2}{minute.2}{second.2}"), ".bmp");

            // Make sure the tool we need exits
            if (DosUtils.FileExist(command))
            {
                if (mTargetXbox != null && mTargetXbox.Length != 0)
                {
                    if (guiCommandLine.ShellExecute(command, string.Concat("/x ", mTargetXbox, " \"", screenShotName, "\""), ProcessWindowStyle.Hidden, ref output) != 0)
                    {
                        MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat("Screen capture was not successful. This is probably due to a disconnected Xbox or an Xbox that was not currently running an application"), MessageBoxButtons.OK);
                    }
                }
                else
                {
                    MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat("Invalid target Xbox defined!"), MessageBoxButtons.OK);
                }
            }
            else
            {
                MOG_REPORT.ShowMessageBox("XBox Tools", string.Concat("This tool is missing, have you updated to the latest version?"), MessageBoxButtons.OK);
            }
        }
        public void TargetXboxRun()
        {
            string  output         = "";
            string  xboxExe        = "";
            string  Autoplay       = "";
            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);
                }
            }

            // Do we auto synch?
            if (mainForm.AssetManagerLocalDataXboxAutoSynchCheckBox.Checked)
            {
                // reset xbox
                TargetXboxReset();
                // Synch the xbox with the local drive first, then run the game
                TargetXboxSynch(false, true);
            }
            else
            {
                // Do we run autoPlay?
                if (mainForm.AssetManagerLocalDataXboxAutoplayCheckBox.Checked)
                {
                    Autoplay = string.Concat(mainForm.AssetManagerLocalDataXboxUserMapComboBox.Text, "?Game=EonEngine.EonGameInfo -NoMenu");
                }

                // Use 'default' as user, if the Default checkbox is checked.  This is used for the programmers who debug their code using the default.xbe
                if (mainForm.AssetManagerLocalDataXboxDefaultCheckBox.Checked)
                {
                    xboxExe = string.Concat("xE:\\", mMog.GetProject().GetProjectName(), "\\default.xbe", " ", Autoplay);
                }
                else
                {
                    xboxExe = string.Concat("xE:\\", mMog.GetProject().GetProjectName(), ".", mMog.GetUser().GetUserName(), "\\default.xbe", " ", Autoplay);
                }

                // Check to see if there is a project defined tool for this
                string RunCommand = "";
                if (buttonDefaults != null)
                {
                    if (buttonDefaults.SectionExist(mMog.GetProject().GetProjectName() + ".Buttons"))
                    {
                        if (buttonDefaults.KeyExist(mMog.GetProject().GetProjectName() + ".Buttons", "Run"))
                        {
                            RunCommand = buttonDefaults.GetString(mMog.GetProject().GetProjectName() + ".Buttons", "Run");
                        }
                    }
                }

                // Get the tool listed on the startup page
                string command = RunCommand;
                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, " ", xboxExe), 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);
                }
            }
        }
Esempio n. 21
0
        public void TargetConsoleSync()
        {
            bool   success     = true;
            string summaryFile = "";

            try
            {
                // Initialize our progress dialog
                mProgress = new CallbackDialogForm();

                // Initialize our summery files for reporting what was copied
                summaryFile = InitializeSummaryMap();

                // Initialize our file map to tell us what patterns to copy
                InitializeFileMap();

                // Initialize a timestamp map to help us not copy over the same stuff every time
                InitializeTimeStampMap();

                if (mConsoleCopy)
                {
                    // Logon to correct xbox
                    XboxUtils.SetXboxName(mTargetConsole, false);
                }

                // Create initial console directory
                InitializeTargetDirectory();

                // Get the total number of files to be copied
                success = InitializeFileCounts();

                string message = "Preforming platform data Sync: \n" +
                                 "   Project Sync file map:" + mProjectSyncFile + "\n" +
                                 "   User Sync file map:" + mUserSyncFile + "\n";

                mProgress.DialogInitialize("(" + mTargetConsole + ")Platform Data Sync", message, "Cancel");
                Application.DoEvents();

                // Walk the 'FileMap' and compare to our local game directory and sync to the Xbox
                if (success)
                {
                    mGetFileCount = false;
                    mFileNumber   = 0;
                    mProgress.CallbackDialogFilesProgressBar.Maximum = mTotalFilesToCopy + 2;

                    // Walk the map file directories
                    for (int i = 0; i < mPlatformSync.CountKeys("FileMap"); i++)
                    {
                        string sourcePath  = FormatString(mPlatformSync.GetKeyNameByIndex("FileMap", i).ToLower());
                        string targetPath  = "";
                        string filePattern = mPlatformSync.GetKeyByIndex("FileMap", i).ToLower();

                        if (RemapString(sourcePath, ref targetPath))
                        {
                            success = SyncDirectories(sourcePath, filePattern, mSyncRoot);

                            // Check if the user has canceled
                            if (!success)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                MOG_REPORT.ShowMessageBox("Console Sync", e.Message.ToString(), MessageBoxButtons.OK);
            }

            // Clean up our progress dialog
            if (mProgress != null)
            {
                mProgress.DialogKill();
                mProgress.CallbackDialogFilesProgressBar.Maximum = 100;
                mProgress = null;
            }

            // Close and save the timestamps file
            if (mTargetTimestamps != null)
            {
                mTargetTimestamps.Save();
                mTargetTimestamps.Close();
            }

            // Close the  platform.sinc.info
            if (mPlatformSync != null)
            {
                mPlatformSync.CloseNoSave();
            }

            // Close the summary file
            if (mSummary != null)
            {
                mSummary.Save();
            }

            // Check if we are supposed to launch the game after the sync
            if (mRunAfterSync)
            {
                RunXbox();
            }

            // Show the update summary form
            if (mShowSummary)
            {
                UpdateBuildSummaryForm summary = new UpdateBuildSummaryForm(summaryFile);
                summary.ShowDialog();
            }
        }
Esempio n. 22
0
        private bool SyncFile(string fullFilename, string targetFile)
        {
            bool rc = false;

            // Check for special rules for this asset in the ReMap section
            if (!RemapString(fullFilename, ref targetFile))
            {
                return(false);
            }

            // Get the file
            FileInfo file = new FileInfo(fullFilename);

            bool fileExists = false;

            if (mConsoleCopy && !mFileMapCreate)
            {
                fileExists = XboxUtils.FileExist(targetFile);
            }
            else if (!mConsoleCopy && !mFileMapCreate)
            {
                fileExists = DosUtils.FileExist(targetFile);
            }
            else
            {
                fileExists = false;
            }

            if (fileExists && !mGetFileCount && mConsoleCopy)
            {
                // Check to see if the sizes of the source and target are the same
                uint targetSize = XboxUtils.GetFileSize(targetFile);
                uint sourceSize = (uint)file.Length;
                if (targetSize != sourceSize)
                {
                    fileExists = false;
                }
            }

            // Check if the target file exists
            // If asset is in our timestamp file, it means we have already copied it once.  We need to check if there is a timestamp difference
            // But if the asset does not even exist on the xbox we should force a copy
            if (fileExists &&
                (mTargetTimestamps.SectionExist("ASSETS") && mTargetTimestamps.KeyExist("ASSETS", file.FullName))
                )
            {
                // Get timestamp of target and source
                // Copy if they are not the same
                if (string.Compare(file.LastWriteTime.ToFileTime().ToString(), mTargetTimestamps.GetString("ASSETS", file.FullName)) != 0)
                {
                    if (mGetFileCount)
                    {
                        mTotalFilesToCopy++;
                        mPendingCopy.PutString("COPY_FILE", file.FullName, targetFile);
                        mPendingCopy.Save();
                    }
                    else
                    {
                        mProgress.DialogUpdate(mFileNumber++, string.Concat("Source: ", file.FullName, "\nTarget: ", targetFile));
                        Application.DoEvents();
                        if (mProgress.DialogProcess())
                        {
                            return(false);
                        }

                        if (mConsoleCopy)
                        {
                            rc = XboxUtils.FileCopyVerify(file.FullName, targetFile, true);
                        }
                        else
                        {
                            rc = DosUtils.FileCopy(file.FullName, targetFile, true);
                        }

                        if (!rc)
                        {
                            mSummary.PutString("File.CopyError", file.FullName, targetFile);
                            mSummary.Save();

                            // Check to see if the reason we failed is because we ran out of space
//							UInt64 freeSpace = XboxUtils.GetDiskFreeSpace(mSyncRoot);
//							if (freeSpace < (ulong)file.Length)
//							{
//								MOG_REPORT.ShowErrorMessageBox("Platform Sync: Out of space!", "There is insufficient space on " + mSyncRoot + " to copy " + file.FullName);
//							}
                        }
                        else
                        {
                            mSummary.PutString("File.Copied", file.FullName, targetFile);
                            mSummary.Save();

                            mTargetTimestamps.PutString("ASSETS", file.FullName, file.LastWriteTime.ToFileTime().ToString());
                            mTargetTimestamps.Save();
                        }
                    }
                }
                else
                {
                    if (!mGetFileCount)
                    {
                        // This file is up to date
                        mProgress.DialogUpdate(mFileNumber, string.Concat("FILE UP TO DATE!  Skipping...\nSource: ", file.FullName));
                        Application.DoEvents();
                        // Check if the user cancels
                        if (mProgress.DialogProcess())
                        {
                            return(false);
                        }
                    }
                }
            }
            else
            {
                if (mGetFileCount)
                {
                    mTotalFilesToCopy++;
                    if (mFileMapCreate)
                    {
                        // When making a file map, put the target first then the source
                        mPendingCopy.PutString("MAP", targetFile, file.FullName);
                    }
                    else
                    {
                        // When making a pending file, put the source first then target
                        mPendingCopy.PutString("COPY_FILE", file.FullName, targetFile);
                    }
                    //mPendingCopy.PutString("COPY_FILE", file.FullName, targetFile);
                    mPendingCopy.Save();
                }
                else
                {
                    mProgress.DialogUpdate(mFileNumber++, string.Concat("Source: ", file.FullName, "\nTarget: ", targetFile));
                    Application.DoEvents();
                    // Check if the user cancels
                    if (mProgress.DialogProcess())
                    {
                        return(false);
                    }

                    CreateTargetDirectoryPath(targetFile.Substring(0, targetFile.LastIndexOf("\\")));

                    // Sync the file to the platform
                    try
                    {
                        if (mConsoleCopy)
                        {
                            rc = XboxUtils.FileCopyVerify(file.FullName, targetFile, true);
                        }
                        else
                        {
                            rc = DosUtils.FileCopy(file.FullName, targetFile, true);
                        }
                        //rc = XboxUtils.FileCopyVerify(file.FullName, targetFile, true);
                    }
                    catch (DllNotFoundException e)
                    {
                        MOG_REPORT.ShowMessageBox("DLL ERROR", e.ToString(), MessageBoxButtons.OK);
                        return(false);
                    }
                    catch (EntryPointNotFoundException e)
                    {
                        MOG_REPORT.ShowMessageBox("DLL ERROR", e.ToString(), MessageBoxButtons.OK);
                        return(false);
                    }
                    if (!rc)
                    {
                        // Error
                        mSummary.PutString("File.CopyError", file.FullName, targetFile);
                        mSummary.Save();

                        // Check to see if the reason we failed is because we ran out of space
                        //UInt64 freeSpace = XboxUtils.GetDiskFreeSpace(mSyncRoot);
                        //if (freeSpace < (ulong)file.Length)
                        //{
                        //	MOG_REPORT.ShowErrorMessageBox("Platform Sync: Out of space!", "There is insufficient space on " + mSyncRoot + " to copy " + file.FullName);
                        //}
                    }
                    else
                    {
                        mSummary.PutString("File.Copied", file.FullName, targetFile);
                        mSummary.Save();

                        mTargetTimestamps.PutString("ASSETS", file.FullName, file.LastWriteTime.ToFileTime().ToString());
                        mTargetTimestamps.Save();
                    }
                }
            }

            return(true);
        }
        public void RefreshTab()
        {
            int     newItems = 0;
            MOG_Ini contents = new MOG_Ini();

            // Determine which boxes we are looking at, Inbox or outBox
            string  boxName     = "Unknown";
            TabPage pagePointer = null;

            if (string.Compare(mParent.mainForm.AssetManagerBoxesTabControl.SelectedTab.Name, "AssetManagerInboxTabPage") == 0)
            {
                boxName     = "Inbox";
                pagePointer = mParent.mainForm.AssetManagerInboxTabControl.TabPages[(int)guiAssetManager.InboxTabOrder.MESSAGES];
            }
            else if (string.Compare(mParent.mainForm.AssetManagerBoxesTabControl.SelectedTab.Name, "AssetManagerOutboxTabPage") == 0)
            {
                boxName     = "Outbox";
                pagePointer = mParent.mainForm.AssetManagerOutboxTabControl.TabPages[(int)guiAssetManager.OutboxTabOrder.MESSAGES];
            }
            else
            {
                MOG_REPORT.ShowMessageBox("ERROR", "No valid box selected in mAssetManager.Messages.RefreshTab", MessageBoxButtons.OK);
                return;
            }

            // Check all tasks for the new status
            FileInfo file = new FileInfo(String.Concat(mParent.mMog.GetActiveUser().GetUserPath(), "\\", boxName, "\\Contents.info"));

            // If the .info file exists, open it
            if (file.Exists)
            {
                // Load the file
                contents.Load(file.FullName);

                // Find the items in the TASKS section
                if (contents.SectionExist("Messages"))
                {
                    for (int i = 0; i < contents.CountKeys("Messages"); i++)
                    {
                        string messageName   = contents.GetKeyNameByIndex("Messages", i);
                        string messageStatus = contents.GetString(messageName, "Status");
                        if (string.Compare(messageStatus, "New", true) == 0)
                        {
                            newItems++;
                        }
                    }
                }
            }

            // If we have new items, update the tab
            string tabName;

            if (newItems > 0)
            {
                tabName = string.Concat("Messages ", boxName, "(", newItems.ToString(), ") New");
            }
            else
            {
                tabName = string.Concat("Messages ", boxName);
            }

            // Store this count
            mNewMessageCount = newItems;

            // Set the tab name
            if (pagePointer != null)
            {
                pagePointer.Text = tabName;
            }
        }