void BirdieWatchObjectRemove(WatchBaseObject watchObject) { Dispatcher.Invoke(() => { ProcessTabItem processTabItem = processDataToTabDictionary[watchObject.ProcessData]; if (watchObject.GetType() == typeof(WatchMemoryObject)) { processTabItem.WatcherControl.MonitoredObjects.Remove((WatchMemoryObject)watchObject); } }); }
void BirdieProcessConnect(ProcessData processData) { Dispatcher.Invoke(() => { ProcessTabItem processTabItem = new ProcessTabItem(processData) { Header = String.Format("{0} ({1})", processData.ProcessName, processData.ProcessId) }; processDataToTabDictionary.Add(processData, processTabItem); processTabControl.Items.Add(processTabItem); if (processTabControl.Items.Count == 1) { processTabControl.SelectedIndex = 0; } }); }