コード例 #1
0
 public static bool RemoveBlessed(MOG_Filename asset, string jobLabel)
 {
     if (MOG_ControllerProject.RemoveAssetFromProject(asset, "No longer needed", jobLabel, false))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
		/// <summary>
		/// Remove a Package from the PackageManagement Tree. 
		///  Adapted from MogControl_AssetContextMenu.cs::MenuItemRemoveFromProject_Click()
		/// </summary>
		private void RemovePackage(MOG_Filename packageName)
		{
			try
			{
				if (!MOG_ControllerProject.RemoveAssetFromProject(packageName, "No longer needed", false))
				{
					return;
				}
			}
			catch (Exception ex)
			{
				MOG_Report.ReportMessage("Remove From Project", ex.Message, ex.StackTrace, MOG.PROMPT.MOG_ALERT_LEVEL.CRITICAL);
			}
		}
コード例 #3
0
        /// <summary>
        /// Remove a Package from the PackageManagement Tree.
        ///  Adapted from MogControl_AssetContextMenu.cs::MenuItemRemoveFromProject_Click()
        /// </summary>
        private void RemovePackageFromProject(Mog_BaseTag packageTag)
        {
            try
            {
                string message = "Are you sure you want to remove this package from the game?\r\n" + packageTag.PackageFullName;

                // If user OKs our removal...
                if (MOG_Prompt.PromptResponse("Remove Asset From Project", message, MOGPromptButtons.OKCancel) == MOGPromptResult.OK)
                {
                    if (packageTag.Execute)
                    {
                        MOG_Filename filename = new MOG_Filename(packageTag.FullFilename);

                        // Make sure we are an asset before showing log
                        if (filename.GetFilenameType() == MOG_FILENAME_TYPE.MOG_FILENAME_Asset)
                        {
                            // Proceed to remove this package from the project; skiping the unpackage merge event
                            if (MOG_ControllerProject.RemoveAssetFromProject(filename, "No longer needed", false))
                            {
                                // Go ahead and actually remove the node
                                packageTag.ItemRemove();
                            }
                            else
                            {
                                MOG_Prompt.PromptMessage("Remove Package From Project Failed",
                                                         "The package could not be removed from the project.\n" +
                                                         "PACKAGE: " + filename.GetAssetFullName() + "\n\n" +
                                                         "We are now aborting the remove process.\n", Environment.StackTrace);
                                return;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MOG_Report.ReportMessage("Remove From Project", ex.Message, ex.StackTrace, MOG.PROMPT.MOG_ALERT_LEVEL.CRITICAL);
            }
        }