Exemple #1
0
 // Token: 0x060003D7 RID: 983 RVA: 0x0000D11C File Offset: 0x0000B31C
 private void WindowButton_Click(object sender, EventArgs e)
 {
     MetroForm.MetroFormButton metroFormButton = sender as MetroForm.MetroFormButton;
     if (metroFormButton != null)
     {
         MetroForm.WindowButtons windowButtons = (MetroForm.WindowButtons)metroFormButton.Tag;
         if (windowButtons == MetroForm.WindowButtons.Close)
         {
             base.Close();
             return;
         }
         if (windowButtons == MetroForm.WindowButtons.Minimize)
         {
             base.WindowState = FormWindowState.Minimized;
             return;
         }
         if (windowButtons == MetroForm.WindowButtons.Maximize)
         {
             if (base.WindowState == FormWindowState.Normal)
             {
                 base.WindowState     = FormWindowState.Maximized;
                 metroFormButton.Text = "2";
                 return;
             }
             base.WindowState     = FormWindowState.Normal;
             metroFormButton.Text = "1";
         }
     }
 }
Exemple #2
0
 // Token: 0x060003D6 RID: 982 RVA: 0x0000D054 File Offset: 0x0000B254
 private void AddWindowButton(MetroForm.WindowButtons button)
 {
     if (this.windowButtonList == null)
     {
         this.windowButtonList = new Dictionary <MetroForm.WindowButtons, MetroForm.MetroFormButton>();
     }
     if (this.windowButtonList.ContainsKey(button))
     {
         return;
     }
     MetroForm.MetroFormButton metroFormButton = new MetroForm.MetroFormButton();
     if (button == MetroForm.WindowButtons.Close)
     {
         metroFormButton.Text = "r";
     }
     else if (button == MetroForm.WindowButtons.Minimize)
     {
         metroFormButton.Text = "0";
     }
     else if (button == MetroForm.WindowButtons.Maximize)
     {
         if (base.WindowState == FormWindowState.Normal)
         {
             metroFormButton.Text = "1";
         }
         else
         {
             metroFormButton.Text = "2";
         }
     }
     metroFormButton.Tag    = button;
     metroFormButton.Size   = new Size(25, 20);
     metroFormButton.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
     metroFormButton.Click += this.WindowButton_Click;
     base.Controls.Add(metroFormButton);
     this.windowButtonList.Add(button, metroFormButton);
 }