protected override void OnClosing(CancelEventArgs e) { this.trafficStats.Save(); this.trafficStats.OnDataChanged -= TrafficStats_OnDataChanged; if (this.ParentForm != null) { this.ParentForm = null; } base.OnClosing(e); }
private void ExitLable_Click(object sender, System.EventArgs e) { this.Close(); if (this.ParentForm != null) { this.ParentForm.Close(); this.ParentForm = null; } controller.ToggleShowStatsSuspention(false); }
private void CreateSuspentionForm() { if (this.trafficStatsSuspentionForm == null) { this.trafficStatsSuspentionForm = new TrafficStatsSuspensionForm(this.controller, this.trafficStats); this.trafficStatsSuspentionForm.FormClosed += TrafficStatsSuspentionForm_FormClosed; this.trafficStatsForm = new TrafficStatsForm(this.trafficStatsSuspentionForm, this.trafficStats); this.trafficStatsForm.FormClosed += TrafficStatsForm_FormClosed; this.trafficStatsSuspentionForm.ParentForm = trafficStatsForm; this.trafficStatsSuspentionForm.Show(); } }
private void SwitchToMain() { if (ParentForm == null) { ParentForm = new TrafficStatsForm(this, trafficStats); } if (ParentForm != null) { ParentForm.Show(); ParentForm.RestoreWindow(); //this.Hide(); } }
private void DestorySuspentionForm() { if (this.trafficStatsSuspentionForm != null) { this.trafficStatsSuspentionForm.Close(); } if (this.trafficStatsForm != null) { this.trafficStatsForm.Close(); } this.trafficStatsForm = null; this.trafficStatsSuspentionForm = null; System.GC.Collect(); }
private void TrafficStatsForm_FormClosed(object sender, FormClosedEventArgs e) { trafficStatsForm.Dispose(); trafficStatsForm = null; Utils.ReleaseMemory(true); }