示例#1
0
        private void btnTestSMTP_Click(object sender, System.EventArgs e)
        {
            if (tbEmailSMTP.Text == "")
            {
                MOG_Prompt.PromptResponse("Missing SMTP Server", "Please enter the name of your SMTP Server", MOGPromptButtons.OK);
                tbEmailSMTP.Focus();
            }
            else
            {
                if (lvUsers.SelectedItems.Count == 0)
                {
                    MOG_Prompt.PromptResponse("No User Selected", "Please select a user in the list to send a test message to his/her email address.", MOGPromptButtons.OK);
                }
                else
                {
                    MOG_User user = CreateUser(lvUsers.SelectedItems[0]);

                    List <object> args = new List <object>();
                    args.Add(user);
                    args.Add(tbEmailSMTP.Text);

                    ProgressDialog progress = new ProgressDialog("Testing SMTP Server", "Sending test message using your SMTP Server", TestSMTP_Worker, args, false);
                    progress.ShowDialog(this);
                }
            }
        }
示例#2
0
        private void SyncDelButton_Click(object sender, EventArgs e)
        {
            if (SyncFilterComboBox.SelectedItem != null)
            {
                ComboBoxItem item = SyncFilterComboBox.SelectedItem as ComboBoxItem;
                if (item != null)
                {
                    string filterFileName = item.FullPath;

                    if (MOG_Prompt.PromptResponse("Delete filter?", "Are you sure you want to delete this filter?\n" + item.FullPath, MOGPromptButtons.YesNo) == MOGPromptResult.Yes)
                    {
                        if (DosUtils.ExistFast(filterFileName) && DosUtils.DeleteFast(filterFileName))
                        {
                            UpdateFilterDropDown("");

                            mFilter.Clear();
                            //if (ClassificationTreeView.Visible)
                            //{
                            ClassificationTreeView.Initialize();
                            //}

                            SyncSaveButton.Enabled  = false;
                            SyncFilterComboBox.Text = mOriginalSyncComboBoxMessage;
                        }
                    }
                }
            }
        }
		/// <summary>
		/// Utility method to make sure we have a valid Package name (which should have an extension)
		/// </summary>
		private bool ValidatePackageExtension(NodeLabelEditEventArgs e, MOG_Filename packageName)
		{
			// Make sure packages have extensions, if not make strong warning
			if (packageName.GetExtension().Length == 0)
			{
				string message = "This package does not have an extension!\r\n"
					+ "Most engines require extensions on packages.\r\n\r\n"
					+ "(Click 'Ignore' to continue without adding an extension)";
				switch (MOG_Prompt.PromptResponse("Create new package", message, MOGPromptButtons.AbortRetryIgnore))
				{
				case MOGPromptResult.Retry:
					e.CancelEdit = true;
					e.Node.TreeView.LabelEdit = true;
					e.Node.BeginEdit();
					return false;
				case MOGPromptResult.Abort:
					e.Node.Remove();
					e.CancelEdit = true;
					return false;
				}
			}

			// We finished the block.  Return true.
			return true;
		}
示例#4
0
        static private void ProjectRefresh()
        {
            string projectName = MOG_ControllerProject.GetProjectName();
            string branchName  = MOG_ControllerProject.GetBranchName();
            string userName    = MOG_ControllerProject.GetUserName();

            // Refresh all my user list controls
            if (guiProject.SetLoginProject(projectName, branchName))
            {
                // Set the login user
                guiUser guiUsers = new guiUser(mainForm);

                if (!guiUsers.SetLoginUser(userName))
                {
                    // Error
                    MOG_Prompt.PromptResponse("Refresh Project", "Unable to refresh user!  Try re-logging in to your project");
                }
            }
            else
            {
                // Error
                MOG_Prompt.PromptResponse("Refresh Project", "No local workspace or login to project failed!, Try re-logging in to your project");
            }

            // Refresh all my project lists
        }
示例#5
0
        private void SyncConfigureButton_Click(object sender, EventArgs e)
        {
            MOG_Privileges privileges = MOG_ControllerProject.GetPrivileges();

            if (privileges.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.ConfigureUpdateFilterPromotions))
            {
                if (SyncConfigureButton.Visible)
                {
                    SyncFilterLabel.Visible        = true;
                    SyncAddButton.Visible          = true;
                    SyncDelButton.Visible          = true;
                    SyncSaveButton.Visible         = true;
                    SyncPromoteButton.Visible      = true;
                    SyncConfigureButton.Visible    = false;
                    ClassificationTreeView.Visible = true;
                    SyncShowAssetsCheckBox.Visible = true;
                    SyncFilterComboBox.Enabled     = true;
                    CloseButton.Visible            = true;
                    SyncFilterComboBox.Width      -= (SyncAddButton.Width * 3) + 6;

                    ClassificationTreeView.Initialize();

                    if (ConfigureFilter != null)
                    {
                        ConfigureFilter(sender, true);
                    }
                }
            }
            else
            {
                MOG_Prompt.PromptResponse("Insufficient Privileges", "Your privileges do not allow you to configure sync filters.");
            }
        }
        private void PackageNewClassificationMenuItem_Click(object sender, EventArgs e)
        {
            MOG_Privileges privs = MOG_ControllerProject.GetPrivileges();

            if (privs.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.AddClassification))
            {
                ToolStripMenuItem item = sender as ToolStripMenuItem;
                if (item != null)
                {
                    ContextMenuStrip contextMenu = item.Owner as ContextMenuStrip;
                    if (contextMenu != null)
                    {
                        MogControl_BaseTreeView treeview = contextMenu.SourceControl as MogControl_BaseTreeView;
                        if (treeview != null)
                        {
                            TreeNode node = treeview.SelectedNode;
                            if (node != null)
                            {
                                ClassificationCreateForm form = new ClassificationCreateForm(node.FullPath);
                                if (form.ShowDialog(treeview.TopLevelControl) == DialogResult.OK)
                                {
                                    treeview.DeInitialize();
                                    treeview.LastNodePath = form.FullClassificationName;
                                    treeview.Initialize();
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                MOG_Prompt.PromptResponse("Insufficient Privileges", "Your privileges do not allow you to add classifications to the project.");
            }
        }
示例#7
0
        private void btnCreate_Click(object sender, System.EventArgs e)
        {
            if (!DuplicateProjectNameCheck(this.projectInfoControl.ProjectName, true))
            {
                this.projectInfoControl.FocusProjectName();
                return;
            }

            if (this.executeCreate)
            {
                MOG_Project proj = CreateProject(true);
                if (proj == null)
                {
                    // If project creation failed, return
                    return;
                }

                MOG_ControllerProject.LoginProject(proj.GetProjectName(), "");

                try
                {
                    Hide();
                    ConfigureProjectWizardForm wiz = new ConfigureProjectWizardForm(proj);
                    wiz.ShowDialog(this);
                }
                catch (Exception ex)
                {
                    MOG_Prompt.PromptResponse("Configure Error", ex.Message, ex.StackTrace, MOGPromptButtons.OK, MOG_ALERT_LEVEL.CRITICAL);
                }
            }

            this.DialogResult = DialogResult.OK;
            Hide();
        }
示例#8
0
        private void AddBranch()
        {
            MOG_Privileges privs = MOG_ControllerProject.GetPrivileges();

            if (privs.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.CreateBranch))
            {
                CreateBranchForm newBranch = new CreateBranchForm();
                newBranch.BranchSourceTextBox.Text = MOG_ControllerProject.GetBranchName();

                if (newBranch.ShowDialog() == DialogResult.OK)
                {
                    // Create the branch
                    if (MOG_ControllerProject.BranchCreate(MOG_ControllerProject.GetBranchName(), newBranch.BranchNameTextBox.Text))
                    {
                        MOG_DBBranchInfo branch = MOG_DBProjectAPI.GetBranch(newBranch.BranchNameTextBox.Text);

                        AddBranchListViewItem(branch);

                        MOG_Prompt.PromptMessage("Create Branch", "New branch successfully created.\n" +
                                                 "BRANCH: " + newBranch.BranchNameTextBox.Text);
                    }
                }
            }
            else
            {
                MOG_Prompt.PromptResponse("Insufficient Privileges", "Your privileges do not allow you to create branches.");
            }
        }
示例#9
0
        public static ArrayList FindDatabases(string serverName)
        {
            ArrayList databases = new ArrayList();

            try
            {
                TimeOut = 1;
                OleDbConnection myConnection = GetConnection(serverName);
                myConnection.Open();
                DataTable schemaTable = myConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Catalogs,
                                                                         null);

                myConnection.Close();
                foreach (DataRow dr in schemaTable.Rows)
                {
                    databases.Add(dr[0] as string);
                }
            }
            catch
            {
                MOG_Prompt.PromptResponse("Open SQL Connection Error!", "Couldn't access server " + serverName + "\nMake sure that this is not an instanced server that would require the instance name.\ni.e MyServer\\InstanceName", "", MOGPromptButtons.OK, MOG_ALERT_LEVEL.ERROR);
            }


            return(databases);
        }
示例#10
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.");
                }
            }
        }
示例#11
0
        /// <summary>
        /// Makes the selected assets the current version in the current branch
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MakeCurrentMenuItem_Click(object sender, System.EventArgs e)
        {
            try
            {
                ArrayList selectedItems  = ControlGetSelectedItems();
                ArrayList assetFilenames = new ArrayList();

                // Scan the list and prepare it for delivery to the DLL
                string message = "";
                foreach (guiAssetTreeTag tag in selectedItems)
                {
                    if (tag.Execute)
                    {
                        MOG_Filename filename = new MOG_Filename(tag.FullFilename);
                        if (filename.GetFilenameType() == MOG_FILENAME_TYPE.MOG_FILENAME_Asset)
                        {
                            assetFilenames.Add(filename);
                        }

                        message = message + filename.GetAssetFullName() + "\n";
                    }
                }

                // Check if this request effects more than 1 asset??
                if (selectedItems.Count > 1)
                {
                    if (MOG_Prompt.PromptResponse("Are you sure you want to make all of these assets the current versions?", message, MOGPromptButtons.OKCancel) != MOGPromptResult.OK)
                    {
                        return;
                    }
                }

                // Stamp all the specified assets
                if (MOG_ControllerProject.MakeAssetCurrentVersion(assetFilenames, "Made current by " + MOG_ControllerProject.GetUserName_DefaultAdmin()))
                {
                    // Check if this request effects more than 1 asset??
                    if (selectedItems.Count > 1)
                    {
                        // Inform the user this may take a while
                        MOG_Prompt.PromptResponse("Completed",
                                                  "This change requires Slave processing.\n" +
                                                  "The project will not reflect these changes until all slaves have finished processing the generated commands.\n" +
                                                  "The progress of this task can be monitored in the Connections Tab.");
                    }
                }
                else
                {
                    MOG_Prompt.PromptMessage("Make Current Failed", "The system was unable to fully complete the task!", Environment.StackTrace);
                }
            }
            catch (Exception ex)
            {
                MOG_Report.ReportMessage("MakeCurrent Exception", ex.Message, ex.StackTrace, MOG.PROMPT.MOG_ALERT_LEVEL.CRITICAL);
            }
        }
示例#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
        private void SQLTestButton_Click(object sender, System.EventArgs e)
        {
            BuildConnectionString();

            SqlConnection myConnection = MOG.DATABASE.MOG_DBAPI.GetOpenSqlConnection(mConnectString);

            MOG_Prompt.PromptResponse("DataBase", "Successfully connected to SQL database " + SQLServerComboBox.Text + "!", MOGPromptButtons.OK);
            //MessageBox.Show("DB", "Successfully connected to SQL database " + SQLServerComboBox.Text + "!",MOGPromptButtons.OK);

            myConnection.Close();
        }
示例#14
0
        private void SQLOkButton_Click(object sender, System.EventArgs e)
        {
            // Test the connection string
            // Attempt to open a connection to make sure we will work?
            BuildConnectionStringNoCatalog();
            string databaseName = this.SQLDatabaseComboBox.Text;

            // Is this a 'Create new' database
            if (this.SQLCreateDatabaseRadioButton.Checked)
            {
                try
                {
                    if (MOG.DATABASE.MOG_DBAPI.DatabaseExists(mConnectString, this.SQLDatabaseTextBox.Text) == false)
                    {
                        if (MOG_Prompt.PromptResponse("Create new Database?", "We will need to create this database to test this connection.\n\n\tDATABASE NAME: " + this.SQLDatabaseTextBox.Text + "\n\nIs it ok to proceed?", MOGPromptButtons.OKCancel) == MOGPromptResult.OK)
                        {
                            if (MOG.DATABASE.MOG_DBAPI.CreateDatabase(mConnectString, this.SQLDatabaseTextBox.Text))
                            {
                                databaseName = SQLDatabaseTextBox.Text;
                            }
                            else
                            {
                                if (MOG_Prompt.PromptResponse("Create Database", "Unable to create database! \n\nDo you want to continue and save these new settings?", MOGPromptButtons.YesNo) == MOGPromptResult.No)
                                {
                                    return;
                                }
                            }
                        }
                        else
                        {
                            return;
                        }
                    }
                }
                catch (Exception ex)
                {
                    MOG_Prompt.PromptMessage("Create Database", "Unable to check or create database with the following message:\n\n" + ex.Message, ex.StackTrace, MOG_ALERT_LEVEL.ERROR);
                    return;
                }
            }

            BuildConnectionString();

            if (!MOG_ControllerSystem.InitializeDatabase(mConnectString, "", ""))
            {
                MOG_Prompt.PromptResponse("Connection Failure", "Couldn't connect to SQL database " + databaseName + " on server " + SQLServerComboBox.Text);
                return;
            }

            // notify others that we clicked the OK button
            OnOKClicked();
        }
示例#15
0
 private void EditOkButton_Click(object sender, System.EventArgs e)
 {
     if (!Regex.IsMatch(this.LabelNameTextBox.Text, "\\S"))
     {
         MOG_Prompt.PromptResponse("Missing Information", "You must enter at least one character (other "
                                   + " than whitespace) into the label, or click 'Cancel' to cancel...");
     }
     else
     {
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }
示例#16
0
        private void GameDataCreateMenuItem_Click(object sender, System.EventArgs e)
        {
            try
            {
                // Create a directory as a child directory of a node
                if (GameDataTreeView.SelectedNode != null)
                {
                    guiAssetTreeTag tag = GameDataTreeView.SelectedNode.Tag as guiAssetTreeTag;

                    string   directoryPath = tag.FullFilename + "\\NewDirectory";
                    TreeNode directory     = CreateDirectoryNode(tag.FullFilename + "\\NewDirectory", null);

                    // Now create the folder
                    if (!DosUtils.DirectoryCreate(directoryPath))
                    {
                        MOG_Prompt.PromptResponse("Create Directory", DosUtils.GetLastError(), MOGPromptButtons.OK);
                    }
                    else
                    {
                        // Now edit the name of this node
                        GameDataTreeView.LabelEdit = true;
                        GameDataTreeView.SelectedNode.Nodes.Add(directory);
                        GameDataTreeView.SelectedNode = directory;
                        GameDataTreeView.SelectedNode.BeginEdit();
                    }
                }
                else
                {
                    // Create a directory at the root of the project
                    string   directoryPath = MOG_ControllerProject.GetCurrentSyncDataController().GetSyncDirectory() + "\\NewDirectory";
                    TreeNode directory     = CreateDirectoryNode(directoryPath, null);

                    // Now create the folder
                    if (!DosUtils.DirectoryCreate(directoryPath))
                    {
                        MOG_Prompt.PromptResponse("Create Directory", DosUtils.GetLastError(), MOGPromptButtons.OK);
                    }
                    else
                    {
                        // Now edit the name of this node
                        GameDataTreeView.LabelEdit    = true;
                        GameDataTreeView.SelectedNode = directory;
                        directory.BeginEdit();
                    }
                }
            }
            catch (Exception ex)
            {
                MOG_Report.ReportMessage("Create Directory", ex.Message, ex.StackTrace, MOG_ALERT_LEVEL.CRITICAL);
            }
        }
示例#17
0
        public void SetUserInbox(string name)
        {
            if (MOG_ControllerProject.GetProject() != null)
            {
                // Is this user valid?
                if (MOG_ControllerProject.GetProject().GetUser(name) != null)
                {
                    // Is this user different from the current user?
                    if (string.Compare(name, mCurrentUsersBox, true) != 0)
                    {
                        MOG_Privileges privs = MOG_ControllerProject.GetPrivileges();

                        if (privs.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.ViewOtherUsersInbox) ||
                            String.Compare(MOG_ControllerProject.GetUserName(), name, true) == 0)
                        {
                            mInboxAssetsDirectory  = "";
                            mOutboxAssetsDirectory = "";
                            mCurrentUsersBox       = name;

                            // Set the active user
                            guiUser user = new guiUser(mainForm);
                            user.SetActiveUser(name);

                            // Are we in our inbox or another teammate
                            Color formBackColor = SystemColors.Window;
                            if (string.Compare(name, MOG_ControllerProject.GetUserName(), true) != 0)
                            {
                                // We are not in our boxes, so lets color them
                                formBackColor = Color.LavenderBlush;
                            }

                            mainForm.AssetManagerInboxListView.BackColor  = formBackColor;
                            mainForm.AssetManagerSentListView.BackColor   = formBackColor;
                            mainForm.AssetManagerTrashListView.BackColor  = formBackColor;
                            mainForm.AssetManagerDraftsListView.BackColor = formBackColor;

                            RefreshAllWindows();
                        }
                        else
                        {
                            MOG_Prompt.PromptResponse("Insufficient Privileges", "Your privileges do not allow you to view other users' inboxes.");
                        }
                    }
                    else
                    {
                        // User is the same, so just update our gui to show correct department and user
                        SetActiveUser(mCurrentUsersBox);
                    }
                }
            }
        }
示例#18
0
        private void DeleteNode(AssetTreeNode selectNode)
        {
            if (selectNode == null)
            {
                return;
            }

            // recurse first
            foreach (AssetTreeNode tn in selectNode.Nodes)
            {
                DeleteNode(tn);
            }

            try
            {
                // now do me
                if (selectNode.AssetNode != null)
                {
                    // deal with the asset node
                    if (selectNode.AssetNode.IsAFile)
                    {
                        selectNode.AssetNode.AssetFilenameNode.fileNodes.Remove(selectNode.AssetNode);
                        if (this.assetTreeView != null)
                        {
                            this.assetTreeView.RebuildSubStructure(selectNode.AssetNode.AssetFilenameNode);
                        }

                        if (selectNode.AssetNode.AssetFilenameNode.fileNodes.Count == 0 && selectNode.AssetNode.AssetFilenameNode.TreeView != null)
                        {
                            selectNode.AssetNode.AssetFilenameNode.Remove();
                        }
                    }
                    else if (selectNode.AssetNode.IsAnAssetFilename && selectNode.AssetNode.fileNodes.Count == 0 && selectNode.AssetNode.TreeView != null)
                    {
                        selectNode.AssetNode.Remove();
                    }
                    else if (selectNode.AssetNode.IsAClassification && selectNode.AssetNode.Nodes.Count == 0 && selectNode.AssetNode.AutoGenerated && selectNode.AssetNode.TreeView != null)
                    {
                        selectNode.AssetNode.Remove();
                    }
                }

                selectNode.DiskNode.SelectedNode = null;
            }
            catch (Exception e)
            {
                MOG_Prompt.PromptResponse("Error", e.Message, e.StackTrace, MOGPromptButtons.OK, MOG_ALERT_LEVEL.CRITICAL);
            }
        }
示例#19
0
        private bool IsInformationValid()
        {
            if (this.PackageNameTextBox.BackColor == Color.Tomato)
            {
                MOG_Prompt.PromptResponse("Package name missing", "Please specify a name for the new package.");
                return(false);
            }

            if (MOG_ControllerProject.DoesAssetExists(MOG_Filename.CreateAssetName(Classification, Platform, PackageName)))
            {
                MOG_Prompt.PromptResponse("Package name not unique", "This package already exists, please specify a unique package name and try again.");
                return(false);
            }

            if (this.ClassificationTextBox.BackColor == Color.Tomato)
            {
                MOG_Prompt.PromptResponse("Classification missing", "Please select a classification for the new package.");
                return(false);
            }

            if (SyncTargetTextBox.Enabled &&
                SyncTargetTextBox.BackColor == Color.Tomato)
            {
                MOG_Prompt.PromptResponse("Sync target missing", "Please select a sync target for the new package.");
                return(false);
            }

            // Check if this package is missing an extension?
            if (Path.GetExtension(PackageName).Length == 0)
            {
                // Check if we are also missing a defined DefaultPackageFileExtension?
                MOG_Properties tempProperties = new MOG_Properties(Classification);
                if (tempProperties.DefaultPackageFileExtension.Length == 0)
                {
                    if (MOG_Prompt.PromptResponse("Warning - Missing extension", "This package does not have an extension.  Most eninges require extensions on packages.\n\nDo you want to continue without and extenstion?", "", MOG.PROMPT.MOGPromptButtons.YesNo, MOG.PROMPT.MOG_ALERT_LEVEL.ALERT) == MOG.PROMPT.MOGPromptResult.No)
                    {
                        return(false);
                    }
                }
            }

            if (this.PlatformCombo.BackColor == Color.Tomato)
            {
                MOG_Prompt.PromptResponse("Invalid Platform", "Please select a valid platform for the new package.");
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Delete directory
        /// </summary>
        private void LocalDirectoryDeleteMenuItem_Click(object sender, System.EventArgs e)
        {
            try
            {
                guiAssetTreeTag tag = (guiAssetTreeTag)GameDataTreeView.SelectedNode.Tag;
                if (MOG_Prompt.PromptResponse("Delete Directory", "Are you sure you wan to delete this directory with all its contents?\n\nDirectory:\n\n" + tag.FullFilename, MOGPromptButtons.YesNo) == MOGPromptResult.Yes)
                {
                    if (tag.Object != null)
                    {
                        // Get our gameData handle from the item's tag
                        MOG_ControllerSyncData gameDataHandle = (MOG_ControllerSyncData)tag.Object;
                        if (gameDataHandle != null)
                        {
                            MOG_Report.ReportMessage("Delete Directory", "Cannot delete a directory that is a MOG Local Workspace! Remove this Workspace first then try again.", Environment.StackTrace, MOG_ALERT_LEVEL.ERROR);
                            return;
//							// Remove the synced location
//							if (!MOG_DBSyncedDataAPI.RemoveSyncedLocation(MOG_ControllerSystem.GetComputerName(), gameDataHandle.GetProjectName(), gameDataHandle.GetPlatformName(), gameDataHandle.GetGameDataPath()))
//							{
//								throw new Exception("Database could not remove this synced location!");
//							}
//
//							// Remove all the updated records
//							string filter = gameDataHandle.GetGameDataPath() + "\\*";
//							if (!MOG_DBInboxAPI.InboxRemoveAllAssets("Local", null, null, filter))
//							{
//								throw new Exception("Database inbox could not remove this synced location!");
//							}
                        }
                    }

                    // Now, actually delete the directory
                    ArrayList FilesToDelete = DosUtils.FileGetRecursiveList(tag.FullFilename, "*.*");

                    ProgressDialog progress = new ProgressDialog("Delete Directory", "Deleting...", LocalDirectoryDelete_Worker, FilesToDelete, true);
                    if (progress.ShowDialog() == DialogResult.OK)
                    {
                        // Now delete all the files left behind
                        Directory.Delete(tag.FullFilename, true);

                        // Remove the node
                        GameDataTreeView.SelectedNode.Remove();
                    }
                }
            }
            catch (Exception ex)
            {
                MOG_Report.ReportMessage("Delete Directory", "Could not delete this directory!\n\nMessage:" + ex.Message, ex.StackTrace, MOG_ALERT_LEVEL.CRITICAL);
            }
        }
示例#21
0
 static public void AddCustomIcons(ImageList list, int index, string key)
 {
     try
     {
         if (list.Images.Count >= index)
         {
             Image icon = list.Images[index] as Image;
             AddIcon(icon, key);
         }
     }
     catch (Exception e)
     {
         MOG_Prompt.PromptResponse("Add Custom Image Failed!", e.Message, e.StackTrace, MOGPromptButtons.OK);
     }
 }
        private void MogControl_BaseTreeView_DragDrop(object sender, DragEventArgs e)
        {
            // We will only accept a ArrayListAssetManager type object
            if (e.Data.GetDataPresent("ProjectTreeView"))
            {
                // Get our array list
                ArrayList items = (ArrayList)e.Data.GetData("ProjectTreeView");

                foreach (TreeNode classObj in items)
                {
                    Mog_BaseTag objInfo = classObj.Tag as Mog_BaseTag;

                    bool success = false;
                    // If we are a classification
                    if (objInfo != null && objInfo.PackageNodeType == PackageNodeTypes.Class)
                    {
                        // Prompt user to make sure they did this intentionally
                        string message = "Are you sure you want to move this classification?\n\n" +
                                         "CLASSIFICATION: " + classObj.Text + "\n" +
                                         "TARGET: " + SelectedNode.FullPath;
                        if (MOG_Prompt.PromptResponse("Move Classification?", message, MOGPromptButtons.YesNoCancel) == MOGPromptResult.Yes)
                        {
                            // Do classification move here!!!
                            success = MOG_ControllerProject.GetProject().ClassificationRename(classObj.FullPath, SelectedNode.FullPath + "~" + classObj.Text);
                        }
                    }
                    // Is it an asset
                    else if (objInfo != null &&
                             (objInfo.PackageNodeType == PackageNodeTypes.Asset || objInfo.PackageNodeType == PackageNodeTypes.Package))
                    {
                        // Prompt user to make sure they did this intentionally
                        string message = "Are you sure you want to move this asset?\n\n" +
                                         "ASSET: " + classObj.Text + "\n" +
                                         "NEW CLASSIFICATION: " + SelectedNode.FullPath;
                        if (MOG_Prompt.PromptResponse("Move Asset?", message, MOGPromptButtons.YesNoCancel) == MOGPromptResult.Yes)
                        {
                            // Do Asset move here!!!
                            MOG_Filename assetFullname = new MOG_Filename(objInfo.FullFilename);
                            success = MOG_ControllerProject.GetProject().AssetRename(classObj.FullPath, SelectedNode.FullPath + "~" + classObj.Text);
                        }
                    }

                    AllowDrop = false;
                }
            }

            AllowDrop = true;
        }
示例#23
0
        internal void Expand()
        {
            MogControl_BaseTreeView treeView = GetRepositoryTreeView();

            if (treeView != null)
            {
                if (treeView.SelectedNode != null)
                {
                    treeView.SelectedNode.ExpandAll();
                }
                else
                {
                    MOG_Prompt.PromptResponse("Expand", "Expand requires a selected node!");
                }
            }
        }
示例#24
0
        internal void Collapse()
        {
            MogControl_BaseTreeView treeView = GetRepositoryTreeView();

            if (treeView != null)
            {
                if (treeView.SelectedNode != null)
                {
                    treeView.SelectedNode.Collapse();
                }
                else
                {
                    MOG_Prompt.PromptResponse("Collapse", "Collapse requires a selected node!");
                }
            }
        }
示例#25
0
 private void GameDataDeleteMenuItem_Click(object sender, System.EventArgs e)
 {
     try
     {
         guiAssetTreeTag tag = (guiAssetTreeTag)GameDataTreeView.SelectedNode.Tag;
         if (MOG_Prompt.PromptResponse("Delete Directory", "Are you sure you wan to delete this directory with all its contents?\n\nDirectory:\n\n" + tag.FullFilename, MOGPromptButtons.YesNo) == MOGPromptResult.Yes)
         {
             // Remove the node
             GameDataTreeView.SelectedNode.Remove();
         }
     }
     catch (Exception ex)
     {
         MOG_Prompt.PromptMessage("Delete Directory", "Could not delete this directory!\n\nMessage:" + ex.Message);
     }
 }
示例#26
0
        private void btnBrowseBuildTool_Click(object sender, System.EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                FileInfo fInfo = new FileInfo(ofd.FileName);
                if (fInfo.Exists)
                {
                    this.buildToolPath    = ofd.FileName;
                    this.tbBuildTool.Text = fInfo.Name + "   [parameters]";
                    string parameters = this.tbBuildTool.Text.Replace(fInfo.Name, "").Trim();
                    parameters = this.tbBuildTool.Text.Trim().Substring(fInfo.Name.Length).Trim();
                    MOG_Prompt.PromptResponse("", "\"" + parameters + "\"");
                }
            }
        }
示例#27
0
        // remove a class node
        private void RemoveClassificationNode(classTreeNode node)
        {
            if (node == null || node.TreeView == null)
            {
                return;
            }

            if (ClassTreeContainsAssets(node.FullPath))
            {
                // can't remove it because it's got children
                MOG_Prompt.PromptResponse("Unable to Remove Classification", "This Classification cannot be removed becuase it or its Subclassifications contain Assets.\nThese Assets must be removed before the Classification can be deleted.\nYou can use the 'Generate Report' feature in the MOG Client to remove this Classification's Assets.", "", MOGPromptButtons.OK, MOG_ALERT_LEVEL.CRITICAL);
                return;
            }

            // make sure they know what they're doing
            if (Utils.ShowMessageBoxConfirmation("Are you sure you want to remove this Classification and all its Subclassifications (if any)?", "Confirm Classification Removal") != MOGPromptResult.Yes)
            {
                return;
            }

            if (this.immediateMode)
            {
                // kill it no matter what
                MOG_ControllerProject.GetProject().ClassificationRemove(node.FullPath);
                node.Remove();
                return;
            }


            if (node.IsNewClass)
            {
                // this is a new node, so it hasn't been saved to the DB yet -- so just remove its node and that's that
                node.Remove();
                if (this.newClasses.Contains(node))
                {
                    this.newClasses.Remove(node);
                }
            }
            else
            {
                // add it to the remove list so we'll remove it from the databse/INIs
                node.props.Classification = node.FullPath;
                this.removedClasses.Add(node);
                node.Remove();
            }
        }
示例#28
0
        private void btnAddUser_Click(object sender, EventArgs e)
        {
            MOG_Privileges privs = MOG_ControllerProject.GetPrivileges();

            if (privs != null)
            {
                if (!privs.GetUserPrivilege(MOG_ControllerProject.GetUserName_DefaultAdmin(), MOG_PRIVILEGE.AddNewUser))
                {
                    MOG_Prompt.PromptResponse("Insufficient Privileges", "Your privileges do not allow you to add users.");
                    return;
                }
            }

            EditUserForm form = new EditUserForm(this, mProject, mPrivileges, null);

            form.ShowDialog(this);
        }
示例#29
0
        private bool ConfigsValid(bool showDialogs, bool refocus)
        {
            if (!this.platformEditor.ConfigurationValid())
            {
                if (showDialogs)
                {
                    MOG_Prompt.PromptResponse("No Platforms", "You must have at least one platform for the project configuration to be valid", "", MOGPromptButtons.OK, MOG_ALERT_LEVEL.CRITICAL);
                }
                if (refocus)
                {
                    this.tabControl.SelectedTab = this.tpPlatforms;
                }

                return(false);
            }

            return(true);
        }
示例#30
0
        public static bool RemoveBlessedGroup(MOG_Filename asset, string groups, bool ShowConfirmation)
        {
            if (MOG_ControllerPackage.RemoveGroup(asset, groups))
            {
                if (ShowConfirmation)
                {
                    string groupString = (groups.Length > 0) ? (" GROUP: " + groups) : "";

                    // Display our message
                    MOG_Prompt.PromptResponse("Asset Remove", asset.GetAssetName() + groupString + " has been successfully removed from the current version info file.  To be completely removed from the game you must rebuild its package.", MOGPromptButtons.OK);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }