Пример #1
0
            private void method_0(object sender, DrawItemEventArgs e)
            {
                DxfLineType dxfLineType = (DxfLineType)((ListBox)sender).Items[e.Index];

                e.DrawBackground();
                int x1     = e.Bounds.Left + 1;
                int top    = e.Bounds.Top;
                int num1   = 100;
                int height = e.Bounds.Height;
                int num2   = (e.Bounds.Top + e.Bounds.Bottom) / 2;

                if (dxfLineType.Elements.Count == 0)
                {
                    e.Graphics.DrawLine(Pens.Black, x1, num2, x1 + num1, num2);
                }
                else
                {
                    int    num3 = 3;
                    double num4 = (double)num1 / (3.0 * dxfLineType.TotalLength);
                    double num5 = 0.0;
                    for (int index = 0; index < num3; ++index)
                    {
                        foreach (DxfLineType.Element element in (List <DxfLineType.Element>)dxfLineType.Elements)
                        {
                            double num6 = num5 + System.Math.Abs(element.Length);
                            if (element.Length == 0.0)
                            {
                                Class735.smethod_3(e.Graphics, System.Drawing.Color.Black, x1 + (int)(num4 * num5), num2);
                            }
                            else if (element.Length > 0.0)
                            {
                                e.Graphics.DrawLine(Pens.Black, x1 + (int)(num4 * num5), num2, x1 + (int)(num4 * num6), num2);
                            }
                            num5 = num6;
                        }
                    }
                }
                e.Graphics.DrawString(dxfLineType.ToString(), SystemFonts.DefaultFont, SystemBrushes.ControlText, new RectangleF((float)(x1 + num1 + 3), (float)e.Bounds.Top, (float)(e.Bounds.Right - (x1 + num1) - 3), (float)e.Bounds.Height));
                e.DrawFocusRectangle();
            }
Пример #2
0
                public override void Draw(
                    PaintEventArgs e,
                    GraphicsHelper graphicsHelper,
                    InteractionContext context)
                {
                    base.Draw(e, graphicsHelper, context);
                    IControlPointCollection controlPoints = this.Interactor.ControlPoints;
                    Matrix4D matrix4D = context.ProjectionTransform * this.Interactor.Entity.Transform;

                    for (int index = 0; index < controlPoints.Count; ++index)
                    {
                        WW.Math.Point2D position = matrix4D.TransformTo2D(controlPoints.Get(index));
                        switch (controlPoints.GetDisplayType(index))
                        {
                        case PointDisplayType.Default:
                            int x = (int)System.Math.Round(position.X);
                            int y = (int)System.Math.Round(position.Y);
                            Class735.smethod_3(e.Graphics, graphicsHelper.DefaultPen.Color, x, y);
                            break;

                        case PointDisplayType.EditHandle:
                            GdiDrawUtil.DrawEditHandle(e.Graphics, graphicsHelper.DefaultPen, position, context.EditHandleSize);
                            break;

                        case PointDisplayType.CrossHair:
                            int num1 = (int)System.Math.Round(position.X);
                            int num2 = (int)System.Math.Round(position.Y);
                            int x1   = (int)System.Math.Round((double)num1 - 0.5 * context.CrossHairSize);
                            int y1   = (int)System.Math.Round((double)num2 - 0.5 * context.CrossHairSize);
                            int x2   = (int)System.Math.Round((double)num1 + 0.5 * context.CrossHairSize);
                            int y2   = (int)System.Math.Round((double)num2 + 0.5 * context.CrossHairSize);
                            e.Graphics.DrawLine(graphicsHelper.DefaultPen, x1, num2, x2, num2);
                            e.Graphics.DrawLine(graphicsHelper.DefaultPen, num1, y1, num1, y2);
                            break;
                        }
                    }
                }