/// <summary>
        /// We need to make sure the users does not create a new group under an object
        /// </summary>
        private void PackageTreeContextMenu_Popup(object sender, CancelEventArgs e)
        {
            ContextMenuStrip contextMenu = sender as ContextMenuStrip;

            // Get our tree, then get our selected node, so we can then get our NodeType (which is defaulted to Class)
            MogControl_PackageTreeView tree = contextMenu.SourceControl as MogControl_PackageTreeView;

            if (tree != null)
            {
                TreeNode node = tree.SelectedNode;
                // If we actually have a node selected...
                if (node != null && node.Tag != null)
                {
                    PackageNodeTypes nodeType = ((Mog_BaseTag)node.Tag).PackageNodeType;

                    // Enable all our MenuItems
                    foreach (ToolStripItem item in contextMenu.Items)
                    {
                        item.Enabled = true;
                    }

                    // Depending on our NodeType, decide which MenuItems will be available to the user
                    switch (nodeType)
                    {
                    // For package and group, we should not be able to create a sub-package
                    case PackageNodeTypes.Asset:
                    case PackageNodeTypes.Package:
                        this.PackageNewClassificationMenuItem.Enabled = false;
                        this.PackageNewPackageMenuItem.Enabled        = false;
                        this.PackageNewPackageSubMenu.Enabled         = false;
                        this.PackageRemoveMenuItem.Enabled            = true;
                        break;

                    case PackageNodeTypes.Group:
                        this.PackageNewClassificationMenuItem.Enabled = false;
                        this.PackageNewPackageMenuItem.Enabled        = false;
                        this.PackageNewPackageSubMenu.Enabled         = false;
                        this.PackageRemoveMenuItem.Enabled            = true;
                        break;

                    // For object, we should not be able to create a package or a sub-group
                    case PackageNodeTypes.Object:
                        this.PackageNewClassificationMenuItem.Enabled = false;
                        this.PackageNewPackageMenuItem.Enabled        = false;
                        this.PackageNewPackageSubMenu.Enabled         = false;
                        this.PackageNewGroupMenuItem.Enabled          = false;
                        this.PackageRemoveMenuItem.Enabled            = true;
                        break;

                    // For class, we should only be able to add a package or remove a package
                    default:                     // PackageNodeTypes.Class:
                        this.PackageNewClassificationMenuItem.Enabled = true;
                        this.PackageNewPackageMenuItem.Enabled        = true;
                        this.PackageNewPackageSubMenu.Enabled         = true;
                        this.PackageNewGroupMenuItem.Enabled          = false;
                        this.PackageNewObjectMenuItem.Enabled         = false;
                        this.PackageRemoveMenuItem.Enabled            = false;
                        break;
                    }

                    // Disable menu items we don't have privileges for
                    MOG_Privileges privileges            = MOG_ControllerProject.GetPrivileges();
                    bool           bCanAddClassification = privileges.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.AddClassification);
                    if (!bCanAddClassification)
                    {
                        PackageNewClassificationMenuItem.Enabled = false;
                    }
                    bool bCanCreatePackage = privileges.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.CreatePackage);
                    if (!bCanCreatePackage)
                    {
                        PackageNewPackageMenuItem.Enabled = false;
                        PackageNewPackageSubMenu.Enabled  = false;
                        PackageRemoveMenuItem.Enabled     = false;
                    }
                    bool bCanCreatePackageGroup = privileges.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.AddPackageGroup);
                    if (!bCanCreatePackageGroup)
                    {
                        PackageNewObjectMenuItem.Enabled = false;
                        PackageNewGroupMenuItem.Enabled  = false;
                        PackageRemoveMenuItem.Enabled    = false;
                    }

                    // Substitute the create package submenu in the place of the create package option depending on the ShowPlatformSpecific option
                    PackageNewPackageMenuItem.Visible = !tree.ShowPlatformSpecific;
                    PackageNewPackageSubMenu.Visible  = tree.ShowPlatformSpecific;
                }
                else
                {
                    foreach (ToolStripItem item in contextMenu.Items)
                    {
                        item.Enabled = false;
                    }
                }
                // Now the ContextMenu will display properly
            }
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MogControl_PackageManagementTreeView));
     this.PackageTreeContextMenu           = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.PackageNewClassificationMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.PackageSeparator1MenuItem        = new System.Windows.Forms.ToolStripSeparator();
     this.PackageNewPackageSubMenu         = new System.Windows.Forms.ToolStripMenuItem();
     this.allToolStripMenuItem             = new System.Windows.Forms.ToolStripMenuItem();
     this.PackageNewPackageMenuItem        = new System.Windows.Forms.ToolStripMenuItem();
     this.PackageNewGroupMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
     this.PackageNewObjectMenuItem         = new System.Windows.Forms.ToolStripMenuItem();
     this.PackageSeparator2MenuItem        = new System.Windows.Forms.ToolStripSeparator();
     this.PackageRemoveMenuItem            = new System.Windows.Forms.ToolStripMenuItem();
     this.PackagesImageList          = new System.Windows.Forms.ImageList(this.components);
     this.PackageTreeViewBottomPanel = new System.Windows.Forms.Panel();
     this.PackagePlatformsCheckBox   = new System.Windows.Forms.CheckBox();
     this.ProjectPackagesTreeView    = new MOG_ControlsLibrary.Controls.MogControl_PackageTreeView();
     this.StateImageList             = new System.Windows.Forms.ImageList(this.components);
     this.PackageTreeContextMenu.SuspendLayout();
     this.PackageTreeViewBottomPanel.SuspendLayout();
     this.SuspendLayout();
     //
     // PackageTreeContextMenu
     //
     this.PackageTreeContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.PackageNewClassificationMenuItem,
         this.PackageSeparator1MenuItem,
         this.PackageNewPackageSubMenu,
         this.PackageNewPackageMenuItem,
         this.PackageNewGroupMenuItem,
         this.PackageNewObjectMenuItem,
         this.PackageSeparator2MenuItem,
         this.PackageRemoveMenuItem
     });
     this.PackageTreeContextMenu.Name     = "PackageTreeContextMenu";
     this.PackageTreeContextMenu.Size     = new System.Drawing.Size(218, 148);
     this.PackageTreeContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.PackageTreeContextMenu_Popup);
     //
     // PackageNewClassificationMenuItem
     //
     this.PackageNewClassificationMenuItem.Name   = "PackageNewClassificationMenuItem";
     this.PackageNewClassificationMenuItem.Size   = new System.Drawing.Size(217, 22);
     this.PackageNewClassificationMenuItem.Text   = "Create new classification";
     this.PackageNewClassificationMenuItem.Click += new System.EventHandler(this.PackageNewClassificationMenuItem_Click);
     //
     // PackageSeparator1MenuItem
     //
     this.PackageSeparator1MenuItem.Name = "PackageSeparator1MenuItem";
     this.PackageSeparator1MenuItem.Size = new System.Drawing.Size(214, 6);
     //
     // PackageNewPackageSubMenu
     //
     this.PackageNewPackageSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.allToolStripMenuItem
     });
     this.PackageNewPackageSubMenu.Name = "PackageNewPackageSubMenu";
     this.PackageNewPackageSubMenu.Size = new System.Drawing.Size(217, 22);
     this.PackageNewPackageSubMenu.Text = "Create new package";
     //
     // allToolStripMenuItem
     //
     this.allToolStripMenuItem.Name   = "allToolStripMenuItem";
     this.allToolStripMenuItem.Size   = new System.Drawing.Size(96, 22);
     this.allToolStripMenuItem.Text   = "All";
     this.allToolStripMenuItem.Click += new System.EventHandler(this.PackageNewPackageMenuItem_Click);
     //
     // PackageNewPackageMenuItem
     //
     this.PackageNewPackageMenuItem.Name   = "PackageNewPackageMenuItem";
     this.PackageNewPackageMenuItem.Size   = new System.Drawing.Size(217, 22);
     this.PackageNewPackageMenuItem.Text   = "Create new package";
     this.PackageNewPackageMenuItem.Click += new System.EventHandler(this.PackageNewPackageMenuItem_Click);
     //
     // PackageNewGroupMenuItem
     //
     this.PackageNewGroupMenuItem.Name   = "PackageNewGroupMenuItem";
     this.PackageNewGroupMenuItem.Size   = new System.Drawing.Size(217, 22);
     this.PackageNewGroupMenuItem.Text   = "Create new group";
     this.PackageNewGroupMenuItem.Click += new System.EventHandler(this.PackageNewGroupMenuItem_Click);
     //
     // PackageNewObjectMenuItem
     //
     this.PackageNewObjectMenuItem.Name   = "PackageNewObjectMenuItem";
     this.PackageNewObjectMenuItem.Size   = new System.Drawing.Size(217, 22);
     this.PackageNewObjectMenuItem.Text   = "Create new package object";
     this.PackageNewObjectMenuItem.Click += new System.EventHandler(this.PackageNewObjectMenuItem_Click);
     //
     // PackageSeparator2MenuItem
     //
     this.PackageSeparator2MenuItem.Name = "PackageSeparator2MenuItem";
     this.PackageSeparator2MenuItem.Size = new System.Drawing.Size(214, 6);
     //
     // PackageRemoveMenuItem
     //
     this.PackageRemoveMenuItem.Name   = "PackageRemoveMenuItem";
     this.PackageRemoveMenuItem.Size   = new System.Drawing.Size(217, 22);
     this.PackageRemoveMenuItem.Text   = "Remove";
     this.PackageRemoveMenuItem.Click += new System.EventHandler(this.PackageRemoveMenuItem_Click);
     //
     // PackagesImageList
     //
     this.PackagesImageList.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("PackagesImageList.ImageStream")));
     this.PackagesImageList.TransparentColor = System.Drawing.Color.Transparent;
     this.PackagesImageList.Images.SetKeyName(0, "");
     this.PackagesImageList.Images.SetKeyName(1, "");
     this.PackagesImageList.Images.SetKeyName(2, "");
     this.PackagesImageList.Images.SetKeyName(3, "");
     //
     // PackageTreeViewBottomPanel
     //
     this.PackageTreeViewBottomPanel.Controls.Add(this.PackagePlatformsCheckBox);
     this.PackageTreeViewBottomPanel.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.PackageTreeViewBottomPanel.Location = new System.Drawing.Point(0, 152);
     this.PackageTreeViewBottomPanel.Name     = "PackageTreeViewBottomPanel";
     this.PackageTreeViewBottomPanel.Size     = new System.Drawing.Size(192, 24);
     this.PackageTreeViewBottomPanel.TabIndex = 9;
     //
     // PackagePlatformsCheckBox
     //
     this.PackagePlatformsCheckBox.Anchor     = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.PackagePlatformsCheckBox.BackColor  = System.Drawing.SystemColors.Control;
     this.PackagePlatformsCheckBox.Checked    = true;
     this.PackagePlatformsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     this.PackagePlatformsCheckBox.FlatStyle  = System.Windows.Forms.FlatStyle.System;
     this.PackagePlatformsCheckBox.Location   = new System.Drawing.Point(8, 0);
     this.PackagePlatformsCheckBox.Name       = "PackagePlatformsCheckBox";
     this.PackagePlatformsCheckBox.Size       = new System.Drawing.Size(144, 24);
     this.PackagePlatformsCheckBox.TabIndex   = 8;
     this.PackagePlatformsCheckBox.Text       = "Show platform-specific";
     this.PackagePlatformsCheckBox.UseVisualStyleBackColor = false;
     this.PackagePlatformsCheckBox.CheckedChanged         += new System.EventHandler(this.PackagePlatformsCheckBox_CheckedChanged);
     //
     // ProjectPackagesTreeView
     //
     this.ProjectPackagesTreeView.AllowItemDrag         = true;
     this.ProjectPackagesTreeView.ArchivedNodeForeColor = System.Drawing.SystemColors.WindowText;
     this.ProjectPackagesTreeView.ContextMenuStrip      = this.PackageTreeContextMenu;
     this.ProjectPackagesTreeView.Dock                            = System.Windows.Forms.DockStyle.Fill;
     this.ProjectPackagesTreeView.ExclusionList                   = "";
     this.ProjectPackagesTreeView.ExpandAssets                    = false;
     this.ProjectPackagesTreeView.ExpandPackageGroupAssets        = false;
     this.ProjectPackagesTreeView.ExpandPackageGroups             = true;
     this.ProjectPackagesTreeView.FocusForAssetNodes              = MOG_ControlsLibrary.Controls.LeafFocusLevel.PackageGroup;
     this.ProjectPackagesTreeView.HideSelection                   = false;
     this.ProjectPackagesTreeView.HotTracking                     = true;
     this.ProjectPackagesTreeView.ImageIndex                      = 0;
     this.ProjectPackagesTreeView.LastNodePath                    = null;
     this.ProjectPackagesTreeView.Location                        = new System.Drawing.Point(0, 0);
     this.ProjectPackagesTreeView.Name                            = "ProjectPackagesTreeView";
     this.ProjectPackagesTreeView.NodesDefaultToChecked           = false;
     this.ProjectPackagesTreeView.PathSeparator                   = "~";
     this.ProjectPackagesTreeView.PersistantHighlightSelectedNode = false;
     this.ProjectPackagesTreeView.SelectedImageIndex              = 0;
     this.ProjectPackagesTreeView.ShowAssets                      = true;
     this.ProjectPackagesTreeView.ShowDescription                 = false;
     this.ProjectPackagesTreeView.ShowPlatformSpecific            = false;
     this.ProjectPackagesTreeView.ShowToolTips                    = false;
     this.ProjectPackagesTreeView.Size                            = new System.Drawing.Size(192, 152);
     this.ProjectPackagesTreeView.TabIndex                        = 10;
     this.ProjectPackagesTreeView.AfterSelect                    += new System.Windows.Forms.TreeViewEventHandler(this.ProjectPackagesTreeView_AfterSelect);
     //
     // StateImageList
     //
     this.StateImageList.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("StateImageList.ImageStream")));
     this.StateImageList.TransparentColor = System.Drawing.Color.Transparent;
     this.StateImageList.Images.SetKeyName(0, "");
     this.StateImageList.Images.SetKeyName(1, "");
     this.StateImageList.Images.SetKeyName(2, "");
     this.StateImageList.Images.SetKeyName(3, "");
     //
     // MogControl_PackageManagementTreeView
     //
     this.Controls.Add(this.ProjectPackagesTreeView);
     this.Controls.Add(this.PackageTreeViewBottomPanel);
     this.Name  = "MogControl_PackageManagementTreeView";
     this.Size  = new System.Drawing.Size(192, 176);
     this.Load += new System.EventHandler(this.MogControl_PackageManagementTreeView_Load);
     this.PackageTreeContextMenu.ResumeLayout(false);
     this.PackageTreeViewBottomPanel.ResumeLayout(false);
     this.ResumeLayout(false);
 }