Пример #1
0
 // Token: 0x06000322 RID: 802 RVA: 0x00008B78 File Offset: 0x00006D78
 public GControl16()
 {
     base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
     this.DoubleBuffered = true;
     GControl16.smethod_5(this, Color.Transparent);
     base.Size   = new Size(44, GControl16.smethod_6(this) + 1);
     this.Cursor = Cursors.Hand;
     this.Font   = new Font("Segoe UI", 10f);
     base.Size   = new Size(76, 33);
 }
Пример #2
0
    // Token: 0x06000323 RID: 803 RVA: 0x00008C48 File Offset: 0x00006E48
    protected virtual void OnPaint(PaintEventArgs e)
    {
        this.method_0();
        Bitmap   bitmap   = GControl16.smethod_8(GControl16.smethod_7(this), GControl16.smethod_6(this));
        Graphics graphics = GControl16.smethod_9(bitmap);

        this.int_0 = GControl16.smethod_7(this) - 1;
        this.int_1 = GControl16.smethod_6(this) - 1;
        GraphicsPath graphicsPath  = GControl16.smethod_10();
        GraphicsPath graphicsPath2 = GControl16.smethod_10();
        Rectangle    rectangle_    = new Rectangle(0, 0, this.int_0, this.int_1);
        Rectangle    rectangle     = new Rectangle(GControl16.smethod_11(this.int_0 / 2), 0, 38, this.int_1);
        Graphics     graphics2     = graphics;

        GControl16.smethod_12(graphics2, SmoothingMode.HighQuality);
        GControl16.smethod_13(graphics2, PixelOffsetMode.HighQuality);
        GControl16.smethod_14(graphics2, TextRenderingHint.ClearTypeGridFit);
        GControl16.smethod_16(graphics2, GControl16.smethod_15(this));
        switch (this.genum3_0)
        {
        case GControl16.GEnum3.Style1:
            graphicsPath  = GClass6.smethod_0(rectangle_, 6);
            graphicsPath2 = GClass6.smethod_0(rectangle, 6);
            GControl16.smethod_18(graphics2, GControl16.smethod_17(this.color_2), graphicsPath);
            GControl16.smethod_18(graphics2, GControl16.smethod_17(this.color_3), graphicsPath2);
            graphics2.DrawString("OFF", GControl16.smethod_19(this), GControl16.smethod_17(this.color_2), new Rectangle(19, 1, this.int_0, this.int_1), GClass6.stringFormat_1);
            if (this.Boolean_0)
            {
                graphicsPath  = GClass6.smethod_0(rectangle_, 6);
                graphicsPath2 = GClass6.smethod_0(new Rectangle(Convert.ToInt32(this.int_0 / 2), 0, 38, this.int_1), 6);
                graphics2.FillPath(new SolidBrush(this.color_3), graphicsPath);
                graphics2.FillPath(new SolidBrush(this.color_0), graphicsPath2);
                graphics2.DrawString("ON", this.Font, new SolidBrush(this.color_0), new Rectangle(8, 7, this.int_0, this.int_1), GClass6.stringFormat_0);
            }
            break;

        case GControl16.GEnum3.Style2:
            graphicsPath  = GClass6.smethod_0(rectangle_, 6);
            rectangle     = new Rectangle(4, 4, 36, this.int_1 - 8);
            graphicsPath2 = GClass6.smethod_0(rectangle, 4);
            graphics2.FillPath(new SolidBrush(this.color_1), graphicsPath);
            graphics2.FillPath(new SolidBrush(this.color_3), graphicsPath2);
            graphics2.DrawLine(new Pen(this.color_2), 18, 20, 18, 12);
            graphics2.DrawLine(new Pen(this.color_2), 22, 20, 22, 12);
            graphics2.DrawLine(new Pen(this.color_2), 26, 20, 26, 12);
            graphics2.DrawString("r", new Font("Marlett", 8f), new SolidBrush(this.color_4), new Rectangle(19, 2, base.Width, base.Height), GClass6.stringFormat_1);
            if (this.Boolean_0)
            {
                graphicsPath  = GClass6.smethod_0(rectangle_, 6);
                rectangle     = new Rectangle(Convert.ToInt32(this.int_0 / 2) - 2, 4, 36, this.int_1 - 8);
                graphicsPath2 = GClass6.smethod_0(rectangle, 4);
                graphics2.FillPath(new SolidBrush(this.color_0), graphicsPath);
                graphics2.FillPath(new SolidBrush(this.color_3), graphicsPath2);
                graphics2.DrawLine(new Pen(this.color_2), Convert.ToInt32(this.int_0 / 2) + 12, 20, Convert.ToInt32(this.int_0 / 2) + 12, 12);
                graphics2.DrawLine(new Pen(this.color_2), Convert.ToInt32(this.int_0 / 2) + 16, 20, Convert.ToInt32(this.int_0 / 2) + 16, 12);
                graphics2.DrawLine(new Pen(this.color_2), Convert.ToInt32(this.int_0 / 2) + 20, 20, Convert.ToInt32(this.int_0 / 2) + 20, 12);
                graphics2.DrawString("ü", new Font("Wingdings", 14f), new SolidBrush(this.color_4), new Rectangle(8, 7, base.Width, base.Height), GClass6.stringFormat_0);
            }
            break;

        case GControl16.GEnum3.Style3:
            graphicsPath = GClass6.smethod_0(rectangle_, 16);
            rectangle    = new Rectangle(this.int_0 - 28, 4, 22, this.int_1 - 8);
            graphicsPath2.AddEllipse(rectangle);
            graphics2.FillPath(new SolidBrush(this.color_3), graphicsPath);
            graphics2.FillPath(new SolidBrush(this.color_1), graphicsPath2);
            graphics2.DrawString("OFF", this.Font, new SolidBrush(this.color_1), new Rectangle(-12, 2, this.int_0, this.int_1), GClass6.stringFormat_1);
            if (this.Boolean_0)
            {
                graphicsPath = GClass6.smethod_0(rectangle_, 16);
                rectangle    = new Rectangle(6, 4, 22, this.int_1 - 8);
                graphicsPath2.Reset();
                graphicsPath2.AddEllipse(rectangle);
                graphics2.FillPath(new SolidBrush(this.color_3), graphicsPath);
                graphics2.FillPath(new SolidBrush(this.color_0), graphicsPath2);
                graphics2.DrawString("ON", this.Font, new SolidBrush(this.color_0), new Rectangle(12, 2, this.int_0, this.int_1), GClass6.stringFormat_1);
            }
            break;

        case GControl16.GEnum3.Style4:
            if (!this.Boolean_0)
            {
            }
            break;

        case GControl16.GEnum3.Style5:
        {
            bool boolean_ = this.Boolean_0;
            break;
        }
        }
        base.OnPaint(e);
        graphics.Dispose();
        e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
        e.Graphics.DrawImageUnscaled(bitmap, 0, 0);
        bitmap.Dispose();
    }