public void crash(string processName) { if (processName.Contains("publisher")) { if (this.site.Equals(this.pubWithSite[processName]) || this.single) { Console.WriteLine(pubWithUrl[processName]); formP.BeginInvoke(formP.myDelegate, pubWithUrl[processName]); IPublisher publisher = (IPublisher)Activator.GetObject( typeof(IPublisher), this.pubWithUrl[processName]); SendCrashAsync RemoteDel = new SendCrashAsync(publisher.crash); IAsyncResult RemAra = RemoteDel.BeginInvoke(null, null); } else { IPuppetMaster puppetM = (IPuppetMaster)Activator.GetObject( typeof(IPuppetMaster), puppets[this.pubWithSite[processName]]); puppetM.crash(processName); } } if (processName.Contains("subscriber")) { if (this.site.Equals(this.subsWithSite[processName]) || this.single) { Console.WriteLine(subsWithUrl[processName]); formP.BeginInvoke(formP.myDelegate, subsWithUrl[processName]); ISubscriber subscriber = (ISubscriber)Activator.GetObject( typeof(ISubscriber), this.subsWithUrl[processName]); SendCrashAsync RemoteDel = new SendCrashAsync(subscriber.crash); IAsyncResult RemAra = RemoteDel.BeginInvoke(null, null); } else { IPuppetMaster puppetM = (IPuppetMaster)Activator.GetObject( typeof(IPuppetMaster), puppets[this.subsWithSite[processName]]); puppetM.crash(processName); } } if (processName.Contains("broker")) { if (this.brokers.Equals(this.brokers[processName]) || this.single) { Console.WriteLine(brokers[processName]); formP.BeginInvoke(formP.myDelegate, brokers[processName]); IBroker broker = (IBroker)Activator.GetObject( typeof(IBroker), this.brokers[processName]); SendCrashAsync RemoteDel = new SendCrashAsync(broker.crash); IAsyncResult RemAra = RemoteDel.BeginInvoke(null, null); } else { IPuppetMaster puppetM = (IPuppetMaster)Activator.GetObject( typeof(IPuppetMaster), puppets[this.brokerNameSite[processName]]); puppetM.crash(processName); } } }