Esempio n. 1
0
        public virtual IShapeHandle CreateBoundingHandle(Shapes.DiagramShape obj, Shapes.DiagramShape selectedObj)
        {
            IShapeHandle handle1 = obj.CreateBoundingHandle();

            if (handle1 == null)
            {
                return(null);
            }
            handle1.SelectedObject = selectedObj;
            Shapes.DiagramShape obj1 = handle1.DiagramShape;
            if (obj1 == null)
            {
                return(null);
            }
            obj1.Selectable = false;
            Shapes.DiagramGraph shape1 = obj1 as Shapes.DiagramGraph;
            if (shape1 != null)
            {
                Color       color1 = Color.LightGray;
                DiagramView view1  = this.View;
                if (view1 != null)
                {
                    if (this.Focused)
                    {
                        if ((this.Primary != null) && (this.Primary.SelectionObject == obj))
                        {
                            color1 = view1.PrimarySelectionColor;
                        }
                        else
                        {
                            color1 = view1.SecondarySelectionColor;
                        }
                    }
                    else
                    {
                        color1 = view1.NoFocusSelectionColor;
                    }
                }
                float single1 = view1.BoundingHandlePenWidth;
                float single2 = (single1 == 0f) ? 0f : (single1 / view1.WorldScale.Width);
                if (((this.myBoundingHandlePen == null) || (Shapes.DiagramGraph.GoPenInfo.GetPenColor(this.myBoundingHandlePen, color1) != color1)) || (this.myBoundingHandlePen.Width != single2))
                {
                    this.myBoundingHandlePen = new Pen(color1, single2);
                }
                shape1.Pen   = this.myBoundingHandlePen;
                shape1.Brush = null;
            }
            this.AddHandle(obj, handle1);
            return(handle1);
        }