/// <summary> 执行 Visio 的外部命令 </summary> /// <param name="assemblyPath">外部命令所对应的dll的绝对路径</param> /// <param name="externalCommand">此命令必须是实现了 IExternalCommand.Execute </param> /// <param name="VisioApp">作为Execute()方法的输入参数的对象,表示当前的Visio Application </param> /// <remarks>出于调试的即时更新的考虑,这里在每一次调试外部命令时,都对最新的dll进行重新加载。</remarks> public static void InvokeExternalCommand(string assemblyPath, IVisioExCommand externalCommand, Application VisioApp) { ExCommandExecutor.RunActiveCommand(externalCommand, assemblyPath, VisioApp); // _currentExternalCommandAssemblyPath = assemblyPath; _currentExternalCommand = externalCommand; }
private void RunExternalCommand(TreeNode ndCommand) { var exCommand = ndCommand.Tag as IVisioExCommand; AddinManagerAssembly asm = ndCommand.Parent.Tag as AddinManagerAssembly; // string assemblyPath = asm.Path; ExCommandExecutor.InvokeExternalCommand(assemblyPath, exCommand, _VisioApplication); }
public static void LastExternalCommand(Application VisioApp) { ExCommandExecutor.InvokeCurrentExternalCommand(VisioApp); }