Beispiel #1
0
        /// <summary>
        /// Edit the ripper in notepad
        /// </summary>
        private void EditRipper()
        {
            if (this.PropertiesList.Length > 0)
            {
                MOG_Properties properties = PropertiesList[0] as MOG_Properties;

                // Get the assigned ripper information
                string ripper = properties.AssetRipper;
                string tool   = DosUtils.FileStripArguments(properties.AssetRipper);
                string args   = DosUtils.FileGetArguments(properties.AssetRipper);

                // Do we have a ripper to edit?
                if (ripper.Length > 0)
                {
                    // Locate the ripper
                    ripper = MOG_ControllerSystem.LocateTool("", tool);
                    if (ripper.Length > 0)
                    {
                        // Edit the ripper
                        guiCommandLine.ShellSpawn("Notepad.exe", ripper);
                    }
                    else
                    {
                        // If not, do we want to create one?
                        if (MOG_Prompt.PromptResponse("No Ripper Found", "This appears to be a new ripper.\n" +
                                                      "RIPPER: " + tool + "\n\n" +
                                                      "Would you like to create a new one for editing?", MOGPromptButtons.YesNo) == MOGPromptResult.Yes)
                        {
                            // Create a new one using the user's specified name
                            string defaultRipperName = tool;
                            ripper = Path.Combine(MOG_ControllerProject.GetProject().GetProjectToolsPath(), defaultRipperName);

                            // Do we want to start from the template?
                            if (MOG_Prompt.PromptResponse("Use Ripper Template", "Would you like to base the new ripper from MOG's ripper template?", MOGPromptButtons.YesNo) == MOGPromptResult.Yes)
                            {
                                // If so, copy the template to this new ripper
                                string template = MOG_ControllerSystem.GetSystemRepositoryPath() + "\\Tools\\Rippers\\TemplateComplex_ripper.bat";

                                DosUtils.CopyFast(template, ripper, false);
                            }

                            // Launch the editor
                            string output = "";
                            guiCommandLine.ShellExecute("Notepad.exe", ripper, System.Diagnostics.ProcessWindowStyle.Normal, ref output);

                            // Now, set this new ripper as the ripper assigned to this asset restoring the users args
                            properties.AssetRipper = ripper + " " + args;
                            this.PropertiesRippingRipperComboBox.Text = properties.AssetRipper;
                        }
                    }
                }
                else
                {
                    MOG_Prompt.PromptMessage("Edit Ripper", "There is no ripper to edit.");
                }
            }
        }
        public override void Initialize()
        {
            AddExtraIcons();

            ImageList   = MogUtil_AssetIcons.Images;
            HotTracking = true;

            mMogPath = MOG_ControllerSystem.GetSystemRepositoryPath();

            Nodes.Clear();

            // Add and Expand the first node in the tree
            ExpandTreeDown();

            // Get our immediate Project Name
            string projectName = MOG_ControllerProject.GetProjectName();

            // If we have no global Project Name AND it is the same as our immediate AND we
            //	have a LastNodePath global...
            if (mProjectName != null && mProjectName == projectName && LastNodePath != null)
            {
                string lastSelectedNodePath = LastNodePath;

                if (mCurrentlyExpandedNodes != null)
                {
                    foreach (string fullPath in mCurrentlyExpandedNodes)
                    {
                        TreeNode lastNode = DrillToNodePath(fullPath);
                        if (lastNode != null)
                        {
                            lastNode.Expand();
                        }
                    }
                }

                // Select the last selected node (if we can find it)
                SelectedNode = DrillToNodePath(lastSelectedNodePath);

                // Set our scroll position back to what it was when the user clicked on their last node
                SetHScrollPosition(this, mSavedScrollPosition.X);
                SetVScrollPosition(this, mSavedScrollPosition.Y);
            }
            else
            {
                // Initialize our projectName, since it's either null or a different value
                mProjectName = projectName;
            }

            bIsInitialized = true;
        }
Beispiel #3
0
        public string RefreshConnectionToolText()
        {
            // get SQL server and MOG Repository drive mapping info
            string connectionString = MOG_ControllerSystem.GetDB().GetConnectionString();
            string sqlServerName    = "NONE";

            if (connectionString.ToLower().IndexOf("data source") != -1)
            {
                // parse out sql server name
                //sqlServerName = connectionString.Substring(connectionString.ToLower().IndexOf("data source=")+13,
                string[] substrings = connectionString.Split(";".ToCharArray());

                // look for correct part o' the connection string
                foreach (string substring in substrings)
                {
                    if (substring.ToLower().StartsWith("data source="))
                    {
                        sqlServerName = substring.Substring(substring.IndexOf("=") + 1).ToUpper();
                    }
                }
            }

            try
            {
                // get MOG repository drive and mapping info
                string mogDrive       = MOG_ControllerSystem.GetSystemRepositoryPath();
                char   mogDriveLetter = Path.GetPathRoot(mogDrive)[0];
                string mogDriveTarget = new NetworkDriveMapper().GetDriveMapping(mogDriveLetter);

                // Connected to X-SERVER @IP 192.168.5.5; SQL Server: JBIANCHI; MOG Repository M: mapped to \\GX\MOG
                //ConnectionString=Packet size=4096;integrated security=SSPI;data source=NEMESIS;persist security info=False;initial catalog=mog16;

                return(string.Concat(MOG_ControllerSystem.GetServerComputerName(), " SQL SERVER: ", sqlServerName));
            }
            catch (Exception e)
            {
                MOG_Report.ReportMessage("RefreshConnectionToolText", e.Message, e.StackTrace, MOG.PROMPT.MOG_ALERT_LEVEL.CRITICAL);
            }

            return("Connected");
        }
        private void InitializeSpecialFolderIconsListView()
        {
            ImageList Icons = new ImageList();

            FolderSpecialFolderListView.LargeImageList = Icons;
            FolderSpecialFolderListView.SmallImageList = Icons;

            FolderSpecialFolderListView.Items.Clear();
            FolderSpecialFolderListView.ShowGroups = true;

            // Get all the system level icons
            string systemIcons = MOG_ControllerSystem.GetSystemRepositoryPath() + "\\Tools\\Images\\Filetypes";

            LoadFileIcons("system", Icons, systemIcons);

            // Get all the system level icons
            if (MOG_ControllerProject.GetProject() != null)
            {
                string projectIcons = MOG_ControllerProject.GetProjectPath() + "\\Tools\\Images";
                LoadFileIcons("project", Icons, projectIcons);
            }
        }
Beispiel #5
0
        string ResolveToken(string token)
        {
            string value = "";

            // Make sure this token starts with the '{'?
            if (token.StartsWith("{"))
            {
                // Get the name of this token
                string[] parts = token.Split("{}.".ToCharArray(), 3);
                // Make sure this resembled a real token?
                if (parts.Length == 3)
                {
                    // Check for any contained commands?
                    string testToken = "{" + parts[1] + "}";
                    // Determine which token we have?
                    switch (testToken)
                    {
                    // Repository Tokens
                    case TOKEN_Repository_Path:
                        value = MOG_ControllerSystem.GetSystemRepositoryPath();
                        break;

                    case TOKEN_Repository_ProjectsPath:
                        value = MOG_ControllerSystem.GetSystemProjectsPath();
                        break;

                    case TOKEN_Repository_ToolsPath:
                        value = MOG_ControllerSystem.GetSystemRepositoryPath() + "\\Tools";
                        break;

                    case TOKEN_Repository_Project_Path:
                        value = MOG_ControllerProject.GetProjectPath();
                        break;

                    case TOKEN_Repository_Project_ToolsPath:
                        value = MOG_ControllerProject.GetProjectPath() + "\\Tools";
                        break;

                    case TOKEN_Repository_Project_AssetsPath:
                        value = MOG_ControllerRepository.GetRepositoryPath();
                        break;

                    case TOKEN_Repository_Project_ArchivePath:
                        value = MOG_ControllerRepository.GetArchivePath();
                        break;

                    case TOKEN_Repository_Project_UsersPath:
                        value = MOG_ControllerProject.GetProjectPath() + "\\Users";
                        break;

                    // Project Tokens
                    case TOKEN_Project_Name:
                        value = MOG_ControllerProject.GetProjectName();
                        break;

                    case TOKEN_Project_BranchName:
                        value = MOG_ControllerProject.GetBranchName();
                        break;

                    case TOKEN_Project_UserName:
                        value = MOG_ControllerProject.GetUserName_DefaultAdmin();
                        break;

                    case TOKEN_Project_PlatformName:
                        value = MOG_ControllerProject.GetPlatformName();
                        break;

                    case TOKEN_Project_WorkspaceDirectory:
                        value = MOG_ControllerProject.GetWorkspaceDirectory();
                        break;

                    // Ripper Tokens
                    case TOKEN_Ripper_SourcePath:
                        value = mRipperSourcePath;
                        break;

                    case TOKEN_Ripper_SourceFilePattern:
                        value = mRipperSourceFilePattern;
                        break;

                    case TOKEN_Ripper_DestinationPath:
                        value = mRipperDestinationPath;
                        break;

                    // Package Tokens
                    case TOKEN_Package_WorkspaceDirectory:
                        if (mPackageFileInfo != null)
                        {
                            value = mPackageFileInfo.mPackageWorkspaceDirectory;
                        }
                        break;

                    case TOKEN_Package_DataDirectory:
                        if (mPackageFileInfo != null)
                        {
                            value = mPackageFileInfo.mPackageDataDirectory;
                        }
                        break;

                    case TOKEN_Package_PackageFile_Filename:
                        if (mPackageFileInfo != null)
                        {
                            value = mPackageFileInfo.mPackageFile;
                        }
                        break;

                    case TOKEN_Package_PackageFile_FullName:
                    {
                        MOG_Filename packageFilename = (mPackageFileInfo != null) ? mPackageFileInfo.mPackageAssetFilename : new MOG_Filename(MOG_ControllerPackage.GetPackageName(mPackageAssignment));
                        value = packageFilename.GetAssetFullName();
                    }
                    break;

                    case TOKEN_Package_PackageFile_Classification:
                    {
                        MOG_Filename packageFilename = (mPackageFileInfo != null) ? mPackageFileInfo.mPackageAssetFilename : new MOG_Filename(MOG_ControllerPackage.GetPackageName(mPackageAssignment));
                        value = packageFilename.GetAssetClassification();
                    }
                    break;

                    case TOKEN_Package_PackageFile_Label:
                    {
                        MOG_Filename packageFilename = (mPackageFileInfo != null) ? mPackageFileInfo.mPackageAssetFilename : new MOG_Filename(MOG_ControllerPackage.GetPackageName(mPackageAssignment));
                        value = packageFilename.GetAssetLabel();
                    }
                    break;

                    case TOKEN_Package_PackageFile_Platform:
                    {
                        MOG_Filename packageFilename = (mPackageFileInfo != null) ? mPackageFileInfo.mPackageAssetFilename : new MOG_Filename(MOG_ControllerPackage.GetPackageName(mPackageAssignment));
                        value = packageFilename.GetAssetPlatform();
                    }
                    break;

                    case TOKEN_Package_PackageFile_Group:
                        value = MOG_ControllerPackage.GetPackageGroups(mPackageAssignment);
                        break;

                    case TOKEN_Package_PackageFile_Object:
                        value = MOG_ControllerPackage.GetPackageObjects(mPackageAssignment);
                        break;

                    // Inbox Tokens
                    case TOKEN_Inbox_UserName:
                        value = mAssetFilename.GetUserName();
                        break;

                    case TOKEN_Inbox_UserPath:
                        value = mAssetFilename.GetUserPath();
                        break;

                    case TOKEN_Inbox_BoxName:
                        value = mAssetFilename.GetBoxName();
                        break;

                    case TOKEN_Inbox_BoxPath:
                        value = mAssetFilename.GetBoxPath();
                        break;

                    // Asset Tokens
                    case TOKEN_Asset_AssetName_Path:
                        value = mAssetFilename.GetPath();
                        break;

                    case TOKEN_Asset_AssetName_FullName:
                        value = mAssetFilename.GetAssetFullName();
                        break;

                    case TOKEN_Asset_AssetName_Classification:
                        value = mAssetFilename.GetAssetClassification();
                        break;

                    case TOKEN_Asset_AssetName_Name:
                        value = mAssetFilename.GetAssetName();
                        break;

                    case TOKEN_Asset_AssetName_PlatformName:
                        value = mAssetFilename.GetAssetPlatform();
                        break;

                    case TOKEN_Asset_AssetName_Label:
                        value = mAssetFilename.GetAssetLabel();
                        break;

                    case TOKEN_Asset_ImportedFile:
                    case TOKEN_Asset_RippedFile:
                        value = ResolveToken_AssetFile(token);
                        break;

                    case TOKEN_Asset_Property:
                        value = ResolveToken_Property(token);
                        break;

                    case TOKEN_Asset_ClassificationPath:
                        value = MOG_Filename.GetClassificationPath(mAssetFilename.GetAssetClassification());
                        break;

                    case TOKEN_Asset_VersionTimeStamp:
                        value = mAssetFilename.GetVersionTimeStamp();
                        break;
                    }

                    // Check if we have a command?
                    if (parts[2] != ".")
                    {
                    }
                }
            }

            return(value);
        }
Beispiel #6
0
        public VersionManagerClass(MOG_ServerManagerMainForm main)
        {
            mainForm = main;
            mainForm.VersionFilesListView.SmallImageList = MogUtil_AssetIcons.Images;
            ListViewSortManager serverVersions = new ListViewSortManager(mainForm.ServerListView, new Type[] {
                typeof(ListViewTextCaseInsensitiveSort),
                typeof(ListViewTextCaseInsensitiveSort)
            });
            ListViewSortManager clientVersions = new ListViewSortManager(mainForm.ClientListView, new Type[] {
                typeof(ListViewTextCaseInsensitiveSort),
                typeof(ListViewTextCaseInsensitiveSort)
            });

            mListViewSort_Manager.Add(serverVersions);
            mListViewSort_Manager.Add(clientVersions);
            mListViewSort_Manager.Add(new ListViewSortManager(mainForm.VersionFilesListView, new Type[] {
                typeof(ListViewTextCaseInsensitiveSort),
                typeof(ListViewDateSort),
                typeof(ListViewInt64Sort)
            }
                                                              ));

            serverVersions.Sort(0, SortOrder.Descending);
            clientVersions.Sort(0, SortOrder.Descending);

            DeploymentDirectory = MOG_ControllerSystem.GetSystem().GetConfigFile().GetString("MOG", "Updates");
            DeploymentDirectory = DeploymentDirectory.ToLower().Replace(MOG_Tokens.GetSystemRepositoryPath().ToLower(), MOG_ControllerSystem.GetSystemRepositoryPath());
        }
Beispiel #7
0
        public guiSound(MogMainForm handle, SplashForm SplashScreen, string configFilename, string soundClass)
        {
            mTheme          = soundClass;
            mHandle         = handle;
            mSoundAvailable = true;

            InitializeSoundEngine();

            // Load the sound ini
            string iniPath    = Application.StartupPath;
            string configFile = string.Concat(iniPath, "\\", configFilename);

            if (DosUtils.FileExist(configFile))
            {
                mConfig    = new MOG_Ini(configFile);
                mSoundPath = string.Concat(iniPath, "\\ClientSounds");

                // Update the sound menu with the scheme choices
                if (mConfig.SectionExist("Themes"))
                {
                    // Add a menuItem for each them found in the ini
                    for (int i = 0; i < mConfig.CountKeys("Themes"); i++)
                    {
                        // Assign the click event to each menu item
                        ToolStripMenuItem item = new ToolStripMenuItem(mConfig.GetKeyNameByIndexSLOW("Themes", i));
                        item.Click += new System.EventHandler(this.SoundMenu_OnClick);

                        // Set the check mark on the theme that pass passed in to the constructor
                        if (string.Compare(item.Text, mTheme, true) == 0)
                        {
                            item.Checked = true;
                        }

                        // Add th menu item
                        mHandle.themeToolStripMenuItem.DropDownItems.Add(item);
                    }

                    // Setup default theme
                    if (mTheme == null)
                    {
                        if (mHandle.themeToolStripMenuItem.DropDownItems.Count > 0)
                        {
                            mTheme = mHandle.themeToolStripMenuItem.DropDownItems[0].Text;
                            ToolStripMenuItem defaultTheme = mHandle.themeToolStripMenuItem.DropDownItems[0] as ToolStripMenuItem;
                            defaultTheme.Checked = true;
                        }
                    }
                }

                // Get our current sounds version
                if (mConfig.SectionExist("Version"))
                {
                    mVersion = Convert.ToInt32(mConfig.GetString("SoundsVersion", "Version"));
                }
                else
                {
                    mVersion = 0;
                }

                // Get all default sounds
                if (mConfig.SectionExist("SOUNDS"))
                {
                    string SourceSoundPath = MOG_ControllerSystem.GetSystemRepositoryPath() + "\\" + mConfig.GetString("Sounds", "Root");
                    // Make sure we have a current sound directory
                    if (!DosUtils.DirectoryExist(mSoundPath))
                    {
                        DosUtils.DirectoryCreate(mSoundPath);
                    }

                    // Make sure we have all the needed sounds
                    if (DosUtils.FileExist(string.Concat(SourceSoundPath, "\\version.ini")))
                    {
                        MOG_Ini soundVersion = new MOG_Ini(string.Concat(SourceSoundPath, "\\version.ini"));

                        int sourceVersion = Convert.ToInt32(soundVersion.GetString("SoundsVersion", "Version"));

                        if (sourceVersion > mVersion)
                        {
                            // Update all our sounds
                            foreach (FileInfo file in DosUtils.FileGetList(SourceSoundPath, "*.wav"))
                            {
                                string target = string.Concat(mSoundPath, "\\", file.Name);
                                if (DosUtils.FileCopyModified(file.FullName, target))
                                {
                                    SplashScreen.updateSplashNoStep("UPDATING: " + file.Name, 0);
                                }
                            }

                            // Update our version number
                            mConfig.PutString("SoundsVersion", "Version", sourceVersion.ToString());
                            mConfig.Save();
                        }
                    }
                }
            }

            // Set the main theme to be the same as this private version
            mHandle.mSoundScheme = mTheme;
        }