Пример #1
0
        /// <summary>
        /// Keeps user from renaming multiple asset labels.
        /// </summary>
        private void RenameNewLabelTextBox_TextChanged(object sender, System.EventArgs e)
        {
            try
            {
                // Check for invalid characters in the new name
                if (MOG_ControllerSystem.InvalidMOGCharactersCheck(RenameNewLabelTextBox.Text, true))
                {
                    RenameNewLabelTextBox.Text = MOG_ControllerSystem.ReplaceInvalidCharacters(RenameNewLabelTextBox.Text);
                }

                // For Rename Label, we only need to worry about one asset...
                if (mFullFilename != null)
                {
                    MOG_Filename currentFilename = new MOG_Filename(this.mFullFilename);
                    string       targetName      = GetTargetName(currentFilename, RenameNewClassNameTextBox.Text,
                                                                 RenameNewPlatformComboBox.Text, RenameNewLabelTextBox.Text);

                    ChangeAssetFilenameInListView(targetName);

                    // Update the imported files column
                    if (RenameFiles.Checked && bInitialized)
                    {
                        ChangeAssetImportnameInListView(RenameNewLabelTextBox.Text);
                    }
                }
            }
            // Eat any errors we get
            catch (Exception ex)
            {
                MOG_Prompt.PromptMessage("Error With Value", ex.Message, ex.StackTrace, MOG_ALERT_LEVEL.ALERT);
            }
        }
Пример #2
0
        private void RenameNewPlatformComboBox_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            try
            {
                // Check for invalid characters in the new name
                if (MOG_ControllerSystem.InvalidMOGCharactersCheck(RenameNewPlatformComboBox.Text, true))
                {
                    RenameNewPlatformComboBox.Text = MOG_ControllerSystem.ReplaceInvalidCharacters(RenameNewPlatformComboBox.Text);
                }

                ChangeAssetFilenamesInListView();
            }
            // Eat any errors we get
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString());
            }
        }
Пример #3
0
        private void RenameNewClassNameTextBox_TextChanged(object sender, System.EventArgs e)
        {
            try
            {
                // Ignore the '*' because it is always set that way when there are multiple assets spanning multiple classifications
                if (RenameNewClassNameTextBox.Text != "*")
                {
                    // Check for invalid characters in the new name
                    if (MOG_ControllerSystem.InvalidMOGCharactersCheck(RenameNewClassNameTextBox.Text, true))
                    {
                        RenameNewClassNameTextBox.Text = MOG_ControllerSystem.ReplaceInvalidCharacters(RenameNewClassNameTextBox.Text);
                    }
                }

                ChangeAssetFilenamesInListView();
            }
            // Eat any errors we get
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString());
            }
        }
Пример #4
0
        private bool VerifyFields()
        {
            // check username
            if (String.IsNullOrEmpty(Username.Text))
            {
                MOG_Prompt.PromptResponse("Missing Data", "Please enter a user name");
                Username.Focus();
                return(false);
            }
            if (Email.Text.IndexOf(" ") != -1)
            {
                MOG_Prompt.PromptResponse("Invalid Character", "Email addresses cannot contian spaces");
                Email.Focus();
                return(false);
            }

            if (MOG_ControllerSystem.InvalidMOGCharactersCheck(Username.Text, false))
            {
                MOG_Prompt.PromptResponse("Please fix the user name", "Invalid Character in user name.  Fix this and try again.");
                Username.Focus();
                return(false);
            }

            if (String.IsNullOrEmpty(Departments.Text))
            {
                MOG_Prompt.PromptResponse("Missing Data", "Please enter a user category");
                Departments.Focus();
                return(false);
            }

            if (String.IsNullOrEmpty(Privileges.Text))
            {
                MOG_Prompt.PromptResponse("Missing Data", "Please enter a user privilege group");
                Privileges.Focus();
                return(false);
            }

            // fixup hand-entered bless target
            foreach (string blessTarget in BlessTargets.Items)
            {
                if (String.Compare(blessTarget, BlessTargets.Text, true) == 0)
                {
                    BlessTargets.SelectedItem = blessTarget;
                }
            }

            if (String.Compare(BlessTargets.Text, Username.Text, true) == 0 &&
                !BlessTargets.Items.Contains(Username.Text))
            {
                BlessTargets.Items.Add(Username.Text);
                BlessTargets.SelectedItem = Username.Text;
            }

            if (String.IsNullOrEmpty(BlessTargets.SelectedItem as string))
            {
                MOG_Prompt.PromptResponse("Missing Data", "Please enter a user bless target");
                BlessTargets.Focus();
                return(false);
            }

            return(true);
        }