Ejemplo n.º 1
0
 protected override void OnResize(EventArgs e)
 {
     base.Width    = (base.Height - 2) * 2;
     this.diameter = base.Width / 2;
     this.artis    = (4f * this.diameter) * 30f;
     this.rect     = new CustomRectangle(2f * this.diameter, this.diameter + 2f, this.diameter / 2f, 1f, 1f);
     this.circle   = new RectangleF(!this.isON ? 1f : ((base.Width - this.diameter) - 1f), 1f, this.diameter, this.diameter);
     base.OnResize(e);
 }
Ejemplo n.º 2
0
        private void DrawRectangle(PaintEventArgs e, CustomRectangle rec, int count)
        {
            //初始的格子位置在 , (11,0),(12,0),(12,1),(11,1)
            int x = rec.LeftTopCorner.X;
            int y = 18 - rec.LeftTopCorner.Y;
            var r = new Rectangle(x * w, y * h, w, h);

            e.Graphics.FillRectangle(new SolidBrush(Color.Black), r);

            e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
            e.Graphics.FillEllipse(Brushes.White, r);
            TextRenderer.DrawText(e.Graphics, $"{count:D2}", this.Font, r, Color.Black,
                                  TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
        }
Ejemplo n.º 3
0
 public CustomToggle()
 {
     this.Cursor              = Cursors.Hand;
     this.DoubleBuffered      = true;
     this.artis               = 4f;
     this.diameter            = 30f;
     this.textEnabled         = true;
     this.rect                = new CustomRectangle(2f * this.diameter, this.diameter + 2f, this.diameter / 2f, 1f, 1f);
     this.circle              = new RectangleF(1f, 1f, this.diameter, this.diameter);
     this.isON                = false;
     this.borderColor         = Color.LightGray;
     this.painTicker.Tick    += new EventHandler(this.paintTicker_Tick);
     this.painTicker.Interval = 1;
     this.OnCol               = Color.FromArgb(28, 72, 33);
     this.OffCol              = Color.DarkGray;
     this.ForeColor           = Color.White;
     this.OnTex               = "";
     this.OffTex              = "";
 }
Ejemplo n.º 4
0
    /// <summary>
    /// Create a new instance of CustomGroup
    /// </summary>
    /// <param name="classList">ClassList</param>
    public CustomGroup(ClassList classList)
    {
        _lstClass = classList;
        float Height = 60, PinPointY = 0;
        //if (string.IsNullOrEmpty(classList.ObjectType))
        //    Height = 55;
        CustomRectangle customRect = new CustomRectangle(0, 0, 220, Height);

        customRect.ClassName           = classList.ClassName;
        customRect.ClassType           = classList.ClassType;
        customRect.ObjectType          = classList.ObjectType;
        customRect.TitleImage          = Image.FromFile(@"..\..\..\..\..\..\..\Common\Images\Diagram\class diagram\5.png");
        customRect.FillStyle.Color     = Color.Transparent;
        customRect.LineStyle.LineColor = Color.Transparent;
        this.AppendChild(customRect);

        PinPointY = customRect.PinPoint.Y + (customRect.Size.Height - customRect.PinPoint.Y);
        if (classList.PropertyList.Count > 0)
        {
            RowRectangle rect = new RowRectangle(0, PinPointY, 220, 25);
            rect.FillStyle.Color     = Color.FromArgb(248, 249, 252);
            rect.LineStyle.LineColor = Color.Transparent;
            rect.Labels[0].OffsetX   = 25;
            rect.RowText             = "Properties";
            this.AppendChild(rect);
            PinPointY = rect.PinPoint.Y + 12.5f;
            for (int i = 0; i < classList.PropertyList.Count; i++)
            {
                RowRectangle rect1 = new RowRectangle(0, PinPointY, 220, 25);
                if (classList.PropertyList[i].PropertyType == PropertyType.Internal)
                {
                    rect1.RowImage = Image.FromFile(@"..\..\..\..\..\..\..\Common\Images\Diagram\class diagram\6.png");
                }
                else
                {
                    rect1.RowImage = Image.FromFile(@"..\..\..\..\..\..\..\Common\Images\Diagram\class diagram\7.png");
                }
                rect1.RowText             = classList.PropertyList[i].PropertyName;
                rect1.FillStyle.Color     = Color.White;
                rect1.LineStyle.LineColor = Color.Transparent;
                this.AppendChild(rect1);
                PinPointY += rect1.PinPoint.Y + (rect1.Size.Height - rect1.PinPoint.Y);
            }
        }

        if (classList.MethodList.Count > 0)
        {
            RowRectangle rect = new RowRectangle(0, PinPointY, 220, 25);
            rect.FillStyle.Color     = Color.FromArgb(248, 249, 252);
            rect.LineStyle.LineColor = Color.Transparent;
            rect.RowText             = "Methods";
            rect.Labels[0].OffsetX   = 25;
            this.AppendChild(rect);
            PinPointY = rect.PinPoint.Y + 12.5f;
            for (int i = 0; i < classList.MethodList.Count; i++)
            {
                RowRectangle rect1 = new RowRectangle(0, PinPointY, 220, 25);
                if (classList.MethodList[i].MethodType == MethodType.Internal)
                {
                    rect1.RowImage = Image.FromFile(@"..\..\..\..\..\..\..\Common\Images\Diagram\class diagram\1.png");
                }
                else if (classList.MethodList[i].MethodType == MethodType.Protected)
                {
                    rect1.RowImage = Image.FromFile(@"..\..\..\..\..\..\..\Common\Images\Diagram\class diagram\2.png");
                }
                else if (classList.MethodList[i].MethodType == MethodType.Public)
                {
                    rect1.RowImage = Image.FromFile(@"..\..\..\..\..\..\..\Common\Images\Diagram\class diagram\3.png");
                }
                rect1.RowText             = classList.MethodList[i].MethodName;
                rect1.FillStyle.Color     = Color.White;
                rect1.LineStyle.LineColor = Color.Transparent;
                this.AppendChild(rect1);
                PinPointY += 25;
            }
        }

        RoundRect roundRect        = new RoundRect(this.Nodes[0].PinPoint.X - 110, this.Nodes[0].PinPoint.Y - 30, this.Size.Width, this.Size.Height + 10, MeasureUnits.Pixel);

        roundRect.FillStyle.Color          = Color.White;
        roundRect.FillStyle.ForeColor      = Color.FromArgb(236, 238, 247);
        roundRect.FillStyle.ForeColor      = Color.FromArgb(222, 226, 241);
        roundRect.FillStyle.Type           = FillStyleType.LinearGradient;
        roundRect.FillStyle.GradientAngle  = 90;
        roundRect.FillStyle.GradientCenter = 1;
        roundRect.LineStyle.LineColor      = Color.FromArgb(199, 205, 231);
        this.AppendChild(roundRect);
        this.SendToBack(roundRect);
    }
Ejemplo n.º 5
0
 public RowRectangle(CustomRectangle src)
     : base(src)
 {
 }