コード例 #1
0
ファイル: ShapeCollection.cs プロジェクト: code-mtnit/WPFSM
 public void AddRange(ShapeCollection shapes)
 {
     foreach (IShape current in shapes)
     {
         base.Add(current);
     }
 }
コード例 #2
0
ファイル: Select.cs プロジェクト: code-mtnit/WPFSM
        protected HitPositions SelectShape(ShapeCollection shapes, Point point)
        {
            if (Control.ModifierKeys != Keys.Control)
            {
                Select.UnselectAll(shapes);
            }
            HitPositions result;

            for (int i = shapes.Count - 1; i >= 0; i--)
            {
                IShape       shape        = shapes[i];
                HitPositions hitPositions = shape.HitTest(point);
                if (hitPositions != HitPositions.None)
                {
                    if (!shape.Locked)
                    {
                        shapes.BringToFront(shape);
                        shape.Selected            = true;
                        Select._lastSelectedShape = shape;
                    }
                    result = hitPositions;
                    return(result);
                }
            }
            result = HitPositions.None;
            return(result);
        }
コード例 #3
0
ファイル: Select.cs プロジェクト: code-mtnit/WPFSM
 public static void UnselectAll(ShapeCollection shapes)
 {
     foreach (IShape current in shapes)
     {
         current.Selected = false;
     }
 }
コード例 #4
0
ファイル: ShapeCollection.cs プロジェクト: code-mtnit/WPFSM
        public virtual object Clone()
        {
            ShapeCollection shapeCollection = new ShapeCollection();

            foreach (IShape current in this)
            {
                shapeCollection.Add(current.Clone() as IShape);
            }
            return(shapeCollection);
        }
コード例 #5
0
ファイル: Select.cs プロジェクト: code-mtnit/WPFSM
        public static ShapeCollection GetSelectedShapes(ShapeCollection shapes)
        {
            ShapeCollection shapeCollection = new ShapeCollection();

            foreach (IShape current in shapes)
            {
                if (current.Selected)
                {
                    shapeCollection.Add(current);
                }
            }
            return(shapeCollection);
        }
コード例 #6
0
ファイル: GridManager.cs プロジェクト: code-mtnit/WPFSM
 public void SnapToGrid(ShapeCollection shapes)
 {
     foreach (IShape current in shapes)
     {
         bool selected = current.Selected;
         bool locked   = current.Locked;
         current.Selected  = true;
         current.Locked    = false;
         current.Location  = this.GetRoundedPoint(current.Location);
         current.Dimension = this.GetRoundedSize(current.Dimension);
         current.Selected  = selected;
         current.Locked    = locked;
     }
 }
コード例 #7
0
ファイル: ShapeCollection.cs プロジェクト: code-mtnit/WPFSM
 public static object[] ToObjects(ShapeCollection shapes)
 {
     object[] result;
     if (shapes.Count == 0)
     {
         result = null;
     }
     else
     {
         object[] array = new object[shapes.Count];
         for (int i = 0; i < shapes.Count; i++)
         {
             array[i] = shapes[i];
         }
         result = array;
     }
     return(result);
 }
コード例 #8
0
 public virtual bool UpdateCursor(IDocument document, ShapeCollection shapes, Point point)
 {
     return(false);
 }