当前位置: 首页>>代码示例>>C#>>正文


C# Document.DocumentChangeEventArgs类代码示例

本文整理汇总了C#中ICSharpCode.AvalonEdit.Document.DocumentChangeEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DocumentChangeEventArgs类的具体用法?C# DocumentChangeEventArgs怎么用?C# DocumentChangeEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DocumentChangeEventArgs类属于ICSharpCode.AvalonEdit.Document命名空间,在下文中一共展示了DocumentChangeEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1:

		void ILineTracker.ChangeComplete(DocumentChangeEventArgs e)
		{
			ILineTracker targetTracker = targetObject.Target as ILineTracker;
			if (targetTracker != null)
				targetTracker.ChangeComplete(e);
			else
				Deregister();
		}
开发者ID:AkshayVats,项目名称:SuperShell,代码行数:8,代码来源:WeakLineTracker.cs

示例2: DocumentOnChanged

        private void DocumentOnChanged(object sender, DocumentChangeEventArgs e)
        {
            SetCurrent();

            var textChangeRange = new TextChangeRange(
                new TextSpan(e.Offset, e.RemovalLength),
                e.RemovalLength == 0 ? e.InsertionLength : e.RemovalLength);
            OnTextChanged(new TextChangeEventArgs(_before, CurrentText, textChangeRange));
        }
开发者ID:Serg2DFX,项目名称:roslynpad,代码行数:9,代码来源:AvalonEditTextContainer.cs

示例3: UpdateOnDocumentChange

		/// <inheritdoc/>
		public override Selection UpdateOnDocumentChange(DocumentChangeEventArgs e)
		{
			if (e == null)
				throw new ArgumentNullException("e");
			return Selection.Create(
				textArea,
				new TextViewPosition(textArea.Document.GetLocation(e.GetNewOffset(startOffset, AnchorMovementType.Default)), start.VisualColumn),
				new TextViewPosition(textArea.Document.GetLocation(e.GetNewOffset(endOffset, AnchorMovementType.Default)), end.VisualColumn)
			);
		}
开发者ID:GraphicGame,项目名称:CSLightStudio,代码行数:11,代码来源:SimpleSelection.cs

示例4: ChangeComplete

        public void ChangeComplete(DocumentChangeEventArgs e)
        {
            if (_lineNumberRemoved > -1)
            {
                _bookmarkManager.AdjustLineOffsets(AdjustTypes.Deleted, _lineNumberRemoved, e.RemovalLength);
                _lineNumberRemoved = -1;
            }

            _bookmarkManager.RecalculateOffsets(_textArea, BookmarkType.Breakpoint, 1);
        }
开发者ID:peterschen,项目名称:SMAStudio,代码行数:10,代码来源:BookmarkLineTracker.cs

示例5: OnAvDocChanged

        private void OnAvDocChanged(object sender, DocumentChangeEventArgs e)
        {
            if (_loading) return;

            _version++;
            Modified = true;
            EventHandler<DocumentChangeEventArgs> handler = Changed;
            if (handler != null)
                handler(sender, e);
        }
开发者ID:JadeHub,项目名称:Jade,代码行数:10,代码来源:TextDocument.cs

示例6: UpdateOnDocumentChange

		/// <inheritdoc/>
		public override Selection UpdateOnDocumentChange(DocumentChangeEventArgs e)
		{
			if (e == null)
				throw new ArgumentNullException("e");
			TextViewPosition newStart = start;
			TextViewPosition newEnd = end;
			// by changing the existing TextViewPosition, we preserve the VisualColumn (though it might become invalid)
			// and the IsAtEndOfLine property.
			newStart.Location = textArea.Document.GetLocation(e.GetNewOffset(startOffset, AnchorMovementType.Default));
			newEnd.Location   = textArea.Document.GetLocation(e.GetNewOffset(endOffset, AnchorMovementType.Default));
			return Selection.Create(textArea, newStart, newEnd);
		}
开发者ID:JadeHub,项目名称:Jade,代码行数:13,代码来源:SimpleSelection.cs

示例7: OnDocumentChanged

		void OnDocumentChanged(DocumentChangeEventArgs e)
		{
			foldings.UpdateOffsets(e);
			FoldingSection s = foldings.FindFirstSegmentWithStartAfter(e.Offset);
			while (s != null && s.StartOffset == e.Offset) {
				FoldingSection next = foldings.GetNextSegment(s);
				if (s.Length == 0) {
					RemoveFolding(s);
				}
				s = next;
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:12,代码来源:FoldingManager.cs

示例8: DocumentOnChanged

        private void DocumentOnChanged(object sender, DocumentChangeEventArgs e)
        {
            if (_updatding) return;

            var oldText = _currentText;

            var textSpan = new TextSpan(e.Offset, e.RemovalLength);
            var textChangeRange = new TextChangeRange(textSpan, e.InsertionLength);
            _currentText = _currentText.WithChanges(new TextChange(textSpan, e.InsertedText?.Text ?? string.Empty));

            TextChanged?.Invoke(this, new TextChangeEventArgs(oldText, _currentText, textChangeRange));
        }
开发者ID:mjheitland,项目名称:TableTweaker,代码行数:12,代码来源:AvalonEditTextContainer.cs

示例9: OnDocumentChanged

		void OnDocumentChanged(DocumentChangeEventArgs e)
		{
			foldings.UpdateOffsets(e);
			int newEndOffset = e.Offset + e.InsertionLength;
			// extend end offset to the end of the line (including delimiter)
			var endLine = document.GetLineByOffset(newEndOffset);
			newEndOffset = endLine.Offset + endLine.TotalLength;
			foreach (var affectedFolding in foldings.FindOverlappingSegments(e.Offset, newEndOffset - e.Offset)) {
				if (affectedFolding.Length == 0) {
					RemoveFolding(affectedFolding);
				} else {
					affectedFolding.ValidateCollapsedLineSections();
				}
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:15,代码来源:FoldingManager.cs

示例10: UpdateOnDocumentChange

		/// <inheritdoc/>
		public override Selection UpdateOnDocumentChange(DocumentChangeEventArgs e)
		{
			if (e == null)
				throw new ArgumentNullException("e");
			int newStartOffset, newEndOffset;
			if (startOffset <= endOffset) {
				newStartOffset = e.GetNewOffset(startOffset, AnchorMovementType.Default);
				newEndOffset = Math.Max(newStartOffset, e.GetNewOffset(endOffset, AnchorMovementType.BeforeInsertion));
			} else {
				newEndOffset = e.GetNewOffset(endOffset, AnchorMovementType.Default);
				newStartOffset = Math.Max(newEndOffset, e.GetNewOffset(startOffset, AnchorMovementType.BeforeInsertion));
			}
			return Selection.Create(
				textArea,
				new TextViewPosition(textArea.Document.GetLocation(newStartOffset), start.VisualColumn),
				new TextViewPosition(textArea.Document.GetLocation(newEndOffset), end.VisualColumn)
			);
		}
开发者ID:AkshayVats,项目名称:SuperShell,代码行数:19,代码来源:SimpleSelection.cs

示例11: OnDocumentChanged

 internal void OnDocumentChanged(DocumentChangeEventArgs e)
 {
     InvalidateVisualColumn();
     if (storedCaretOffset >= 0) {
         int newCaretOffset = e.GetNewOffset(storedCaretOffset, AnchorMovementType.Default);
         TextDocument document = textArea.Document;
         if (document != null) {
             // keep visual column
             this.Position = new TextViewPosition(document.GetLocation(newCaretOffset), position.VisualColumn);
         }
     }
     storedCaretOffset = -1;
 }
开发者ID:hardliner66,项目名称:ATMELGitSCC,代码行数:13,代码来源:Caret.cs

示例12: Push

 internal void Push(TextDocument document, DocumentChangeEventArgs e)
 {
     if (state == StatePlayback)
         throw new InvalidOperationException("Document changes during undo/redo operations are not allowed.");
     if (state == StatePlaybackModifyDocument)
         state = StatePlayback; // allow only 1 change per expected modification
     else
         Push(new DocumentChangeOperation(document, e));
 }
开发者ID:arkanoid1,项目名称:Yanitta,代码行数:9,代码来源:UndoStack.cs

示例13: textArea_Document_Changing

 void textArea_Document_Changing(object sender, DocumentChangeEventArgs e)
 {
     if (e.Offset + e.RemovalLength == this.StartOffset && e.RemovalLength > 0) {
         Close(); // removal immediately in front of completion segment: close the window
         // this is necessary when pressing backspace after dot-completion
     }
     if (e.Offset == StartOffset && e.RemovalLength == 0 && ExpectInsertionBeforeStart) {
         StartOffset = e.GetNewOffset(StartOffset, AnchorMovementType.AfterInsertion);
         this.ExpectInsertionBeforeStart = false;
     } else {
         StartOffset = e.GetNewOffset(StartOffset, AnchorMovementType.BeforeInsertion);
     }
     EndOffset = e.GetNewOffset(EndOffset, AnchorMovementType.AfterInsertion);
 }
开发者ID:Jaimerh,项目名称:lsystems-csharp-lib,代码行数:14,代码来源:CompletionWindowBase.cs

示例14: DoReplace

		void DoReplace(int offset, int length, string newText, OffsetChangeMap offsetChangeMap)
		{
			if (length == 0 && newText.Length == 0)
				return;
			
			// trying to replace a single character in 'Normal' mode?
			// for single characters, 'CharacterReplace' mode is equivalent, but more performant
			// (we don't have to touch the anchorTree at all in 'CharacterReplace' mode)
			if (length == 1 && newText.Length == 1 && offsetChangeMap == null)
				offsetChangeMap = OffsetChangeMap.Empty;
			
			string removedText = rope.ToString(offset, length);
			DocumentChangeEventArgs args = new DocumentChangeEventArgs(offset, removedText, newText, offsetChangeMap);
			
			// fire DocumentChanging event
			if (Changing != null)
				Changing(this, args);
			
			cachedText = null; // reset cache of complete document text
			fireTextChanged = true;
			DelayedEvents delayedEvents = new DelayedEvents();
			
			lock (lockObject) {
				// create linked list of checkpoints, if required
				if (currentCheckpoint != null) {
					currentCheckpoint = currentCheckpoint.Append(args);
				}
				
				// now update the textBuffer and lineTree
				if (offset == 0 && length == rope.Length) {
					// optimize replacing the whole document
					rope.Clear();
					rope.InsertText(0, newText);
					lineManager.Rebuild();
				} else {
					rope.RemoveRange(offset, length);
					lineManager.Remove(offset, length);
					#if DEBUG
					lineTree.CheckProperties();
					#endif
					rope.InsertText(offset, newText);
					lineManager.Insert(offset, newText);
					#if DEBUG
					lineTree.CheckProperties();
					#endif
				}
			}
			
			// update text anchors
			if (offsetChangeMap == null) {
				anchorTree.HandleTextChange(args.CreateSingleChangeMapEntry(), delayedEvents);
			} else {
				foreach (OffsetChangeMapEntry entry in offsetChangeMap) {
					anchorTree.HandleTextChange(entry, delayedEvents);
				}
			}
			
			// raise delayed events after our data structures are consistent again
			delayedEvents.RaiseEvents();
			
			// fire DocumentChanged event
			if (Changed != null)
				Changed(this, args);
		}
开发者ID:ootsby,项目名称:SharpDevelop,代码行数:64,代码来源:TextDocument.cs

示例15: document_Changed

		void document_Changed(object sender, DocumentChangeEventArgs e)
		{
			if (DocumentChanged != null)
				DocumentChanged(this, e);
		}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:5,代码来源:SharpDevelopInsightWindow.cs


注:本文中的ICSharpCode.AvalonEdit.Document.DocumentChangeEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。