private void OnHandleCreated(object sender, EventArgs e) { Log.d("Main dialog handle created."); List <ProcessOptions> launchOptions = Settings.Instance.Read <List <ProcessOptions> > (Properties.Resources.SettingsProcessListNode); Log.d("Launch options parsed. Number of launch processes: {0}", launchOptions.Count); if (Settings.Instance.IsSensuInterfaceEnabled) { SensuInterfaceUpdateTimer.Enabled = true; SensuInterfaceUpdateTimer.Tick += OnSensuInterfaceUpdateTimerTick; SetSensuInterfaceUpdateTimerInterval(Settings.Instance.SensuInterfaceTTL); sensuInterface = new SensuInterface( ProcessManager, Settings.Instance.SensuInterfaceHost, Settings.Instance.SensuInterfacePort, Settings.Instance.SensuInterfaceTTL); } launchOptions.ForEach((opt) => { ProcessManager.Add(opt); }); ProcessManager.ProcessesChanged += OnProcessManagerPropertyChanged; CpuChart = MetricsChart.Series[nameof(CpuChart)]; GpuChart = MetricsChart.Series[nameof(GpuChart)]; RamChart = MetricsChart.Series[nameof(RamChart)]; }
private void DisposeAddedComponents() { screenshotService?.Dispose(); metricsManager?.Dispose(); ProcessManager?.Dispose(); sensuInterface?.Dispose(); editProcessForm?.Dispose(); addProcessForm?.Dispose(); settingsForm?.Dispose(); aboutForm?.Dispose(); logsForm?.Dispose(); screenshotService = null; metricsManager = null; ProcessManager = null; sensuInterface = null; editProcessForm = null; addProcessForm = null; settingsForm = null; aboutForm = null; logsForm = null; }