コード例 #1
0
ファイル: DropMarker.cs プロジェクト: xwyangjshb/qizmt
        /// <summary>
        /// Collects the last dropped DropMarker
        /// </summary>
        /// <remarks>
        /// When a DropMarker is collected the current document posision is moved
        /// to the DropMarker posision, the DropMarker is removed from the stack
        /// and the visual indicator is removed.
        /// </remarks>
        public void Collect()
        {
            while (_markerStack.Count > 0)
            {
                DropMarker dm = _markerStack.Pop();

                //	If the Drop Marker was deleted in the document by
                //	a user action it will be disposed but not removed
                //	from the marker stack. In this case just pretend
                //	like it doesn't exist and go on to the next one
                if (dm.IsDisposed)
                {
                    continue;
                }

                //	The MarkerCollection fires a cancellable event.
                //	If it is canclled the Collect() method will return
                //	false. In this case we need to push the marker back
                //	on the stack so that it will still be collected in
                //	the future.
                if (!dm.Collect())
                {
                    _markerStack.Push(dm);
                }

                return;
            }
        }
コード例 #2
0
ファイル: DropMarker.cs プロジェクト: xwyangjshb/qizmt
        /// <summary>
        /// Drops a DropMarker at the specified document position
        /// </summary>
        /// <param name="position"></param>
        /// <returns>The newly created DropMarker</returns>
        /// <remarks>
        /// Dropping a DropMarker creates a visual marker (red triangle)
        /// indicating the DropMarker point.
        /// </remarks>
        public DropMarker Drop(int position)
        {
            DropMarker dm = new DropMarker(position, position, getCurrentTopOffset(), Scintilla);

            _allDocumentDropMarkers.Add(dm);
            _markerStack.Push(dm);
            Scintilla.ManagedRanges.Add(dm);

            //	Force the Drop Marker to paint
            Scintilla.Invalidate(dm.GetClientRectangle());
            return(dm);
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the DropMarkerCollectEventArgs class.
 /// </summary>
 /// <param name="dropMarker"></param>
 public DropMarkerCollectEventArgs(DropMarker dropMarker)
 {
     _dropMarker = dropMarker;
 }