예제 #1
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.");
            }
        }
예제 #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;
                        }
                    }
                }
            }
        }
예제 #3
0
        public void LoadFilter(string filterName)
        {
            // Is this an already fully qualified name?
            if (DosUtils.ExistFast(filterName) == false)
            {
                // No, then lets assume it came from the user's tools directory
                filterName = MOG_ControllerSystem.LocateTool(filterName + ".sync");
            }

            SyncFilterComboBox.Text = Path.GetFileNameWithoutExtension(filterName);
            SyncFilterComboBox.Tag  = filterName;

            if (DosUtils.ExistFast(filterName))
            {
                //if (ClassificationTreeView.Visible)
                //{
                // Reset the tree
                ClassificationTreeView.Initialize(OnWorkerCompleteLoadFilter);
                //}
                //else
                //{
                //    OnWorkerCompleteLoadFilter();
                //}
            }
        }
예제 #4
0
        private bool ApplyFilter(string filterString, bool checkedState)
        {
            if (filterString.Length > 0)
            {
                // Load and iterate through the exclusions
                string[] parts = filterString.Split(",;".ToCharArray());
                if (parts != null && parts.Length > 0)
                {
                    foreach (string filter in parts)
                    {
                        // Find the node
                        TreeNode node = ClassificationTreeView.DrillToNodePath(filter);
                        if (node != null)
                        {
                            // Set the checked state
                            node.Checked = checkedState;
                            if (node.Parent != null)
                            {
                                node.Collapse();
                            }
                        }
                    }
                }

                return(true);
            }

            return(false);
        }
예제 #5
0
        public PackageCreator()
        {
            InitializeComponent();

            // Make sure we are not in the designer / DesignMode
            //if (GetService(typeof(System.ComponentModel.Design.IDesignerHost)) == null)
            if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
            {
                MOG_Project project = MOG_ControllerProject.GetProject();
                if (project != null)
                {
                    PlatformCombo.Items.Add("All");
                    PlatformCombo.SelectedIndex = 0;

                    foreach (MOG_Platform platform in project.GetPlatforms())
                    {
                        PlatformCombo.Items.Add(platform.mPlatformName);
                    }

                    PlatformCombo.Items.Add(MOG_ControllerProject.GetAllPlatformsString());

                    ClassificationTreeView.Initialize(DrillToClassification);
                    SyncTargetTreeView.InitializeVirtual(Platform);

                    PlatformCombo.BackColor = Color.PaleGreen;
                }
            }

            IsTextBoxValid(this.PackageNameTextBox);
            IsTextBoxValid(this.SyncTargetTextBox);
            IsTextBoxValid(this.ClassificationTextBox);
        }
예제 #6
0
 private void SyncShowAssetsCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     ClassificationTreeView.ShowAssets = SyncShowAssetsCheckBox.Checked;
     //if (ClassificationTreeView.Visible)
     //{
     ClassificationTreeView.Initialize();
     //}
 }
예제 #7
0
 private void DrillToClassification()
 {
     if (!String.IsNullOrEmpty(Classification))
     {
         TreeNode node = ClassificationTreeView.DrillToNodePath(Classification);
         if (node != null)
         {
             ClassificationTreeView.SelectedNode = node;
         }
     }
 }