Example #1
0
 protected override void OnClosing(CancelEventArgs e)
 {
     this.trafficStats.Save();
     this.trafficStats.OnDataChanged -= TrafficStats_OnDataChanged;
     if (this.ParentForm != null)
     {
         this.ParentForm = null;
     }
     base.OnClosing(e);
 }
Example #2
0
        private void ExitLable_Click(object sender, System.EventArgs e)
        {
            this.Close();
            if (this.ParentForm != null)
            {
                this.ParentForm.Close();
                this.ParentForm = null;
            }

            controller.ToggleShowStatsSuspention(false);
        }
Example #3
0
 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();
     }
 }
Example #4
0
        private void SwitchToMain()
        {
            if (ParentForm == null)
            {
                ParentForm = new TrafficStatsForm(this, trafficStats);
            }

            if (ParentForm != null)
            {
                ParentForm.Show();
                ParentForm.RestoreWindow();
                //this.Hide();
            }
        }
Example #5
0
 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();
 }
Example #6
0
 private void TrafficStatsForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     trafficStatsForm.Dispose();
     trafficStatsForm = null;
     Utils.ReleaseMemory(true);
 }