public override PluginReturns Run(PluginArgument arg) { if (arg.Rows == null || arg.Rows.Length < 1) { SimpleMessage.ShowInfo("Please select file to open with Reflector."); return(PluginReturns.None); } try { if (!this.SelectReflector(arg.Host, false)) { if (SimpleMessage.Confirm("Failed to locate .Net Reflector! Do you want to download now?") == System.Windows.Forms.DialogResult.Yes) { SimpleProcess.Start("http://www.reflector.net/"); } return(PluginReturns.None); } string path = GetReflector(arg.Host); try { if (!RemoteController.Available) { Process p = new Process(); p.StartInfo.FileName = path; p.StartInfo.WorkingDirectory = Path.GetDirectoryName(path); p.Start(); } int count = 0; while (!RemoteController.Available && count < 60) { Thread.Sleep(500); count++; } if (RemoteController.Available) { for (int i = 0; i < arg.Rows.Length; i++) { RemoteController.LoadAssembly(Path.Combine(arg.SourceDir, arg.Rows[i])); } } } catch (Exception ex) { SimpleMessage.ShowException(ex); } } catch { throw; } return(PluginReturns.None); }
private void LoadAssembly(Type type) { string fullName = type.Module.FullyQualifiedName; RemoteController.LoadAssembly(fullName); }