コード例 #1
0
        /// <summary>
        /// Start up the resize tool, assuming <see cref="M:Northwoods.Go.GoToolResizing.CanStart" /> returned true.
        /// </summary>
        /// <remarks>
        /// This sets the <see cref="P:Northwoods.Go.GoTool.CurrentObject" /> to be the
        /// <see cref="P:Northwoods.Go.IGoHandle.HandledObject" /> of the handle returned by
        /// <see cref="M:Northwoods.Go.GoToolResizing.PickResizeHandle(System.Drawing.PointF)" />.
        /// It starts a transaction, hides any selection handles for the current
        /// object, and remembers the object's <see cref="P:Northwoods.Go.GoToolResizing.OriginalBounds" /> and
        /// the handle's <see cref="P:Northwoods.Go.GoToolResizing.OriginalPoint" />.
        /// Finally it calls <see cref="M:Northwoods.Go.GoToolResizing.DoResizing(Northwoods.Go.GoInputState)" /> with an event type of
        /// <c>GoInputState.Start</c>.
        /// </remarks>
        public override void Start()
        {
            IGoHandle goHandle = PickResizeHandle(base.FirstInput.DocPoint);

            if (goHandle == null)
            {
                return;
            }
            GoObject handledObject = goHandle.HandledObject;

            if (handledObject == null)
            {
                return;
            }
            base.CurrentObject = handledObject;
            StartTransaction();
            if (base.Selection.GetHandleCount(handledObject) > 0)
            {
                mySelectedObject = goHandle.SelectedObject;
                if (HidesSelectionHandles)
                {
                    mySelectionHidden = true;
                    handledObject.RemoveSelectionHandles(base.Selection);
                }
            }
            ResizeHandle              = goHandle;
            OriginalBounds            = handledObject.Bounds;
            OriginalPoint             = goHandle.GoObject.GetSpotLocation(1);
            base.LastInput.InputState = GoInputState.Start;
            DoResizing(GoInputState.Start);
        }
コード例 #2
0
        /// <summary>
        /// Start relinking by by calling <see cref="M:Northwoods.Go.GoToolLinking.StartRelink(Northwoods.Go.IGoLink,System.Boolean,System.Drawing.PointF)" />
        /// and hiding any selection handles for the link.
        /// </summary>
        /// <remarks>
        /// This assumes that <see cref="P:Northwoods.Go.GoToolLinking.Link" /> and <see cref="P:Northwoods.Go.GoToolLinking.Forwards" />
        /// properties have been set, as is normally done by the <see cref="M:Northwoods.Go.GoToolRelinking.CanStart" /> method.
        /// </remarks>
        public override void Start()
        {
            base.Start();
            GoObject currentObject = base.CurrentObject;

            if (currentObject != null && base.Selection.GetHandleCount(currentObject) > 0)
            {
                mySelectionHidden = true;
                currentObject.RemoveSelectionHandles(base.Selection);
            }
            StartRelink(base.Link, base.Forwards, base.LastInput.DocPoint);
        }
コード例 #3
0
ファイル: GoSelection.cs プロジェクト: lian5599/NewSolution
 /// <summary>
 /// Call <see cref="M:Northwoods.Go.GoObject.AddSelectionHandles(Northwoods.Go.GoSelection,Northwoods.Go.GoObject)" /> on the
 /// <see cref="P:Northwoods.Go.GoObject.SelectionObject" /> of each selected object
 /// if <see cref="M:Northwoods.Go.GoObject.CanView" /> is true, or call
 /// <see cref="M:Northwoods.Go.GoObject.RemoveSelectionHandles(Northwoods.Go.GoSelection)" /> otherwise.
 /// </summary>
 /// <seealso cref="M:Northwoods.Go.GoSelection.RemoveAllSelectionHandles" />
 public void AddAllSelectionHandles()
 {
     using (GoCollectionEnumerator goCollectionEnumerator = GetEnumerator())
     {
         while (goCollectionEnumerator.MoveNext())
         {
             GoObject current         = goCollectionEnumerator.Current;
             GoObject selectionObject = current.SelectionObject;
             if (selectionObject != null)
             {
                 if (current.CanView())
                 {
                     selectionObject.AddSelectionHandles(this, current);
                 }
                 else
                 {
                     selectionObject.RemoveSelectionHandles(this);
                 }
             }
         }
     }
 }