/// <summary> /// Handle the 'New package' menu item click /// </summary> private void PackageNewPackageMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem menuItem = sender as ToolStripMenuItem; if (ProjectPackagesTreeView.SelectedNode != null) { Mog_BaseTag tag = ProjectPackagesTreeView.SelectedNode.Tag as Mog_BaseTag; if (tag != null && tag.PackageNodeType == PackageNodeTypes.Class) { PackageCreator creator = new PackageCreator(); creator.Classification = ProjectPackagesTreeView.SelectedNode.FullPath; if (menuItem != null) { if (MOG_ControllerProject.IsValidPlatform(menuItem.Text) || String.Compare(menuItem.Text, MOG_ControllerProject.GetAllPlatformsString(), true) == 0) { creator.Platform = menuItem.Text; } } if (creator.ShowDialog(this) == DialogResult.OK) { if (creator.AssetName != null) { // Re-create the tree then drill down to the newly created package ProjectPackagesTreeView.DeInitialize(); ProjectPackagesTreeView.LastNodePath = creator.AssetName.GetAssetClassification() + ProjectPackagesTreeView.PathSeparator + creator.AssetName.GetAssetName(); ProjectPackagesTreeView.Initialize(); } } } } }
private void RenameOkButton_Click(object sender, System.EventArgs e) { mNewFilename = new MOG_Filename(this.RenameNewClassNameTextBox.Text + "{" + this.RenameNewPlatformComboBox.Text + "}" + this.RenameNewLabelTextBox.Text); mNewMultiFilename = new MOG_Filename(this.mCommonClass + "{" + this.mCommonPlatform + "}" + this.mCommonLabel); mCommonClass = RenameNewClassNameTextBox.Text; mCommonPlatform = RenameNewPlatformComboBox.Text; mCommonLabel = RenameNewLabelTextBox.Text; // Validate the platform if (string.Compare(mCommonPlatform, "*", true) != 0 && !MOG_ControllerProject.IsValidPlatform(mCommonPlatform)) { // Inform them that this is an invalid platform string message = string.Concat("The specified platform does not exist.\n\n", "The asset was not renamed."); MOG_Prompt.PromptResponse("Asset Rename Failed", message, null, MOGPromptButtons.OK, MOG_ALERT_LEVEL.ALERT); return; } Rename(); }