Esempio n. 1
0
 public void ProcessTick()
 {
     if (Properties.Settings.Default.DiscoOn)
     {
         RandomStyle();
     }
     styleManager.Style = Properties.Settings.Default.Theme;
     Style = styleManager.Style;
     var thisType = typeof (MetroColors);
     var theMethod = thisType.GetMethod("get_" + Style);
     var c = new MetroColors();
     btn_Settings.BackColor = (Color) theMethod.Invoke(c, null);
     styleManager.Update();
 }
        public void ArrangeApperance(int color)
        {
            titleLabel.Text   = _properties.Title;
            messageLabel.Text = _properties.Message;

            switch (_properties.Icon)
            {
            case MessageBoxIcon.Exclamation:
                Body.BackColor = _warningColor;
                break;

            case MessageBoxIcon.Error:
                Body.BackColor = _errorColor;
                break;

            default: break;
            }

            switch (_properties.Buttons)
            {
            case MessageBoxButtons.OK:
                EnableButton(metroButton1);

                metroButton1.Text     = "OK";
                metroButton1.Location = metroButton3.Location;
                metroButton1.Tag      = DialogResult.OK;

                EnableButton(metroButton2, false);
                EnableButton(metroButton3, false);
                break;

            case MessageBoxButtons.OKCancel:
                EnableButton(metroButton1);

                metroButton1.Text     = "OK";
                metroButton1.Location = metroButton2.Location;
                metroButton1.Tag      = DialogResult.OK;

                EnableButton(metroButton2);

                metroButton2.Text     = "Cancel";
                metroButton2.Location = metroButton3.Location;
                metroButton2.Tag      = DialogResult.Cancel;

                EnableButton(metroButton3, false);
                break;

            case MessageBoxButtons.RetryCancel:
                EnableButton(metroButton1);

                metroButton1.Text     = "Retry";
                metroButton1.Location = metroButton2.Location;
                metroButton1.Tag      = DialogResult.Retry;

                EnableButton(metroButton2);

                metroButton2.Text     = "Cancel";
                metroButton2.Location = metroButton3.Location;
                metroButton2.Tag      = DialogResult.Cancel;

                EnableButton(metroButton3, false);
                break;

            case MessageBoxButtons.YesNo:
                EnableButton(metroButton1);

                metroButton1.Text     = "Yes";
                metroButton1.Location = metroButton2.Location;
                metroButton1.Tag      = DialogResult.Yes;

                EnableButton(metroButton2);

                metroButton2.Text     = "No";
                metroButton2.Location = metroButton3.Location;
                metroButton2.Tag      = DialogResult.No;

                EnableButton(metroButton3, false);
                break;

            case MessageBoxButtons.YesNoCancel:
                EnableButton(metroButton1);

                metroButton1.Text = "Yes";
                metroButton1.Tag  = DialogResult.Yes;

                EnableButton(metroButton2);

                metroButton2.Text = "No";
                metroButton2.Tag  = DialogResult.No;

                EnableButton(metroButton3);

                metroButton3.Text = "Cancel";
                metroButton3.Tag  = DialogResult.Cancel;

                break;

            case MessageBoxButtons.AbortRetryIgnore:
                EnableButton(metroButton1);

                metroButton1.Text = "Abort";
                metroButton1.Tag  = DialogResult.Abort;

                EnableButton(metroButton2);

                metroButton2.Text = "Retry";
                metroButton2.Tag  = DialogResult.Retry;

                EnableButton(metroButton3);

                metroButton3.Text = "Ignore";
                metroButton3.Tag  = DialogResult.Ignore;

                break;

            default: break;
            }

            Body.BackColor = MetroColors.Convert_to_Color(color);
        }
 public static Pen Convert_to(int select_color) => GetSavePen(MetroDefaults.Convert_to_String(select_color), MetroColors.Convert_to_Color(select_color));
Esempio n. 4
0
 public static SolidBrush Convert_to(int select_color) => GetSaveBrush(MetroDefaults.Convert_to_String(select_color), MetroColors.Convert_to_Color(select_color));