private void LogOpened(object sender, EventArgs args) { ChildProcessLogGeneratorCollection.ChildProcessLogGenerator childProcessLogGenerator = sender as ChildProcessLogGeneratorCollection.ChildProcessLogGenerator; if (!this.dict.ContainsKey(childProcessLogGenerator.Key)) { this.dict.Add(childProcessLogGenerator.Key, childProcessLogGenerator); } }
private void LogClosed(object sender, EventArgs args) { ChildProcessLogGeneratorCollection.ChildProcessLogGenerator childProcessLogGenerator = sender as ChildProcessLogGeneratorCollection.ChildProcessLogGenerator; if (childProcessLogGenerator != null && this.dict.ContainsKey(childProcessLogGenerator.Key)) { this.dict.Remove(childProcessLogGenerator.Key); if (this.OnLogClosed != null) { this.OnLogClosed(this, new EventArgs <ChildProcessLogDisconnectMessage>(new ChildProcessLogDisconnectMessage(childProcessLogGenerator.ClientID, childProcessLogGenerator.ProcessName, childProcessLogGenerator.PID))); } } }
public bool MakeGenerator(RCClient client, RCProcess process, int pid) { string key = ChildProcessLogGeneratorCollection.MakeKey(client.ID, process.Name, pid); if (this.dict.ContainsKey(key)) { return(false); } ChildProcessLogGeneratorCollection.ChildProcessLogGenerator childProcessLogGenerator = new ChildProcessLogGeneratorCollection.ChildProcessLogGenerator(client, process, pid); this.dict.Add(key, childProcessLogGenerator); childProcessLogGenerator.OnOpen += this.LogOpened; childProcessLogGenerator.OnClose += this.LogClosed; return(true); }