/// <summary> /// Called immediately after a tool is executed by the GeoProcessor. /// </summary> /// <param name="Tool"></param> /// <param name="Values"></param> /// <param name="result"></param> /// <param name="Messages"></param> void IGeoProcessorEvents.PostToolExecute(IGPTool Tool, IArray Values, int result, IGPMessages Messages) { GPMessageEventArgs[] messages = new GPMessageEventArgs[Messages.Count]; IGPMessage gpMessage = null; for (int i = 0; i < Messages.Count; i++) { gpMessage = Messages.GetMessage(i); GPMessageEventArgs message = new GPMessageEventArgs(gpMessage.Description, gpMessage.Type, gpMessage.ErrorCode); messages[i] = message; } //create a new instance of GPPostToolExecuteEventArgs GPPostToolExecuteEventArgs e = new GPPostToolExecuteEventArgs(); e.DisplayName = Tool.DisplayName; e.Name = Tool.Name; e.PathName = Tool.PathName; e.Toolbox = Tool.Toolbox.Alias; e.ToolCategory = Tool.ToolCategory; e.ToolType = Tool.ToolType; e.Description = Tool.Description; e.Result = result; //fire the Post tool event if (null != GPPostToolExecute) { GPPostToolExecute(this, e); } }
/// <summary> /// Called immediately after a tool is executed by the GeoProcessor. /// </summary> /// <param name="Tool"></param> /// <param name="Values"></param> /// <param name="result"></param> /// <param name="Messages"></param> void IGeoProcessorEvents.PostToolExecute(IGPTool Tool, IArray Values, int result, IGPMessages Messages) { GPMessageEventArgs[] messages = new GPMessageEventArgs[Messages.Count]; IGPMessage gpMessage = null; for (int i = 0; i < Messages.Count; i++) { gpMessage = Messages.GetMessage(i); GPMessageEventArgs message = new GPMessageEventArgs(gpMessage.Description, gpMessage.Type, gpMessage.ErrorCode); messages[i] = message; } //create a new instance of GPPostToolExecuteEventArgs GPPostToolExecuteEventArgs e = new GPPostToolExecuteEventArgs(); e.DisplayName = Tool.DisplayName; e.Name = Tool.Name; e.PathName = Tool.PathName; e.Toolbox = Tool.Toolbox.Alias; e.ToolCategory = Tool.ToolCategory; e.ToolType = Tool.ToolType; e.Description = Tool.Description; e.Result = result; //fire the Post tool event if (null != GPPostToolExecute) GPPostToolExecute(this, e); }
static void OnGPPostToolExecute(object sender, GPPostToolExecuteEventArgs e) { System.Diagnostics.Trace.WriteLine(e.Result.ToString()); }