private void AddClassification_Click(object sender, EventArgs e) { MOG_Privileges privs = MOG_ControllerProject.GetPrivileges(); if (privs.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.AddClassification)) { ToolStripItem item = sender as ToolStripItem; if (item != null) { ContextMenuStrip strip = item.Owner as ContextMenuStrip; if (strip != null) { MogControl_FullTreeView treeview = strip.SourceControl as MogControl_FullTreeView; if (treeview != null) { TreeNode node = treeview.SelectedNode; if (node != null) { ClassificationCreateForm form = new ClassificationCreateForm(node.FullPath); if (form.ShowDialog(treeview.TopLevelControl) == DialogResult.OK) { Classification = form.FullClassificationName; treeview.Initialize(DrillToClassification); } } } } } } else { MOG_Prompt.PromptResponse("Insufficient Privileges", "Your privileges do not allow you to add classifications to the project."); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(BrowseClassTreeForm)); this.BrowseOKButton = new System.Windows.Forms.Button(); this.BrowseCancelButton = new System.Windows.Forms.Button(); this.mBaseLeafTreeView = new MogControl_FullTreeView(); this.ClassContextMenu = new System.Windows.Forms.ContextMenu(); this.SuspendLayout(); // // BrowseOKButton // this.BrowseOKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.BrowseOKButton.DialogResult = System.Windows.Forms.DialogResult.OK; this.BrowseOKButton.FlatStyle = System.Windows.Forms.FlatStyle.System; this.BrowseOKButton.Location = new System.Drawing.Point(176, 296); this.BrowseOKButton.Name = "BrowseOKButton"; this.BrowseOKButton.TabIndex = 0; this.BrowseOKButton.Text = "OK"; this.BrowseOKButton.Click += new System.EventHandler(this.OKButton_Click); // // BrowseCancelButton // this.BrowseCancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.BrowseCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.BrowseCancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System; this.BrowseCancelButton.Location = new System.Drawing.Point(256, 296); this.BrowseCancelButton.Name = "BrowseCancelButton"; this.BrowseCancelButton.TabIndex = 1; this.BrowseCancelButton.Text = "Cancel"; // // mBaseLeafTreeView // this.mBaseLeafTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.mBaseLeafTreeView.ArchivedNodeForeColor = System.Drawing.SystemColors.WindowText; this.mBaseLeafTreeView.ContextMenu = this.ClassContextMenu; this.mBaseLeafTreeView.ExpandAssets = false; this.mBaseLeafTreeView.ExpandPackageGroupAssets = false; this.mBaseLeafTreeView.ExpandPackageGroups = false; this.mBaseLeafTreeView.FocusForAssetNodes = LeafFocusLevel.RepositoryItems; this.mBaseLeafTreeView.HotTracking = true; this.mBaseLeafTreeView.Location = new System.Drawing.Point(8, 8); this.mBaseLeafTreeView.Name = "mBaseLeafTreeView"; this.mBaseLeafTreeView.PathSeparator = "~"; this.mBaseLeafTreeView.ShowAssets = false; this.mBaseLeafTreeView.Size = new System.Drawing.Size(328, 280); this.mBaseLeafTreeView.TabIndex = 2; // // BrowseClassTreeForm // this.AcceptButton = this.BrowseOKButton; this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.CancelButton = this.BrowseCancelButton; this.ClientSize = new System.Drawing.Size(344, 325); this.Controls.Add(this.mBaseLeafTreeView); this.Controls.Add(this.BrowseCancelButton); this.Controls.Add(this.BrowseOKButton); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; this.Name = "BrowseClassTreeForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Select Class Name..."; this.ResumeLayout(false); }