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


C# TextEditor.DocumentChangeEventArgs类代码示例

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


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

示例1: TextReplaced

		public void TextReplaced (object sender, DocumentChangeEventArgs args)
		{
			throw new NotSupportedException ("Operation not supported on this line splitter.");
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:4,代码来源:PrimitiveLineSplitter.cs

示例2: HandleSkipCharsOnReplace

		void HandleSkipCharsOnReplace (object sender, DocumentChangeEventArgs args)
		{
			var skipChars = GetTextEditorData ().SkipChars;
			for (int i = 0; i < skipChars.Count; i++) {
				var sc = skipChars [i];
				if (args.Offset > sc.Offset) {
					skipChars.RemoveAt (i);
					i--;
					continue;
				}
				if (args.Offset <= sc.Offset) {
					sc.Offset += args.ChangeDelta;
				}
			}
		}
开发者ID:John-Colvin,项目名称:monodevelop,代码行数:15,代码来源:ExtensibleTextEditor.cs

示例3: OnTextReplacing

		void OnTextReplacing (object s, DocumentChangeEventArgs a)
		{
			oldReplaceText = a.RemovedText;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:4,代码来源:SourceEditorView.cs

示例4: HandleTextEditorDataDocumentTextReplaced

		void HandleTextEditorDataDocumentTextReplaced (object sender, DocumentChangeEventArgs e)
		{
			RemoveMarkers (false);
		}
开发者ID:pvergara,项目名称:monodevelop,代码行数:4,代码来源:HighlightUsagesExtension.cs

示例5: HandleTextReplacing

		void HandleTextReplacing (object sender, DocumentChangeEventArgs e)
		{
			wasInVerbatimString = null;
			var o = e.Offset + e.RemovalLength;
			if (o < 0 || o + 1 > textEditorData.Length || e.RemovalLength != 1 || textEditorData.Document.IsInUndo) {
				return;
			}
			if (textEditorData.GetCharAt (o) != '"')
				return;
			SafeUpdateIndentEngine (o + 1);
			wasInVerbatimString = stateTracker.IsInsideVerbatimString;
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:12,代码来源:CSharpTextEditorIndentation.cs

示例6: OnTextReplacing

		protected virtual void OnTextReplacing (DocumentChangeEventArgs args)
		{
			if (TextReplacing != null)
				TextReplacing (this, args);
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:5,代码来源:TextDocument.cs

示例7: HandleTextReplaced

		void HandleTextReplaced (object sender, DocumentChangeEventArgs args)
		{
			if (Document.CurrentAtomicUndoOperationType == OperationType.Format)
				return;

			int startIndex = args.Offset;
			foreach (var marker in currentErrorMarkers) {
				var line = marker.LineSegment;
				if (line == null || line.Contains (args.Offset) || line.Contains (args.Offset + args.InsertionLength) || args.Offset < line.Offset && line.Offset < args.Offset + args.InsertionLength) {
					markersToRemove.Enqueue (marker);
				}
			}
			ResetRemoveMarker ();
		}
开发者ID:stephenoakman,项目名称:monodevelop,代码行数:14,代码来源:SourceEditorView.cs

示例8: HandleInfoDocumentTextEditorDataDocumentTextReplaced

		void HandleInfoDocumentTextEditorDataDocumentTextReplaced (object sender, DocumentChangeEventArgs e)
		{
			foreach (var data in localUpdate.ToArray ()) {
				data.Document.TextReplaced -= HandleDataDocumentTextReplaced;
				data.Replace (e.Offset, e.RemovalLength, e.InsertedText.Text);
				data.Document.TextReplaced += HandleDataDocumentTextReplaced;
				data.Document.CommitUpdateAll ();
			}
		}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:9,代码来源:EditorCompareWidgetBase.cs

示例9: HandleDataDocumentTextReplaced

		void HandleDataDocumentTextReplaced (object sender, DocumentChangeEventArgs e)
		{
			var data = dict [(TextDocument)sender];
			localUpdate.Remove (data);
			var editor = info.Document.GetContent<MonoDevelop.Ide.Editor.ITextDocument> ();
			editor.ReplaceText (e.Offset, e.RemovalLength, e.InsertedText.Text);
			localUpdate.Add (data);
			UpdateDiff ();
		}
开发者ID:gAdrev,项目名称:monodevelop,代码行数:9,代码来源:EditorCompareWidgetBase.cs

示例10: HandleTextReplaced

		void HandleTextReplaced (object sender, DocumentChangeEventArgs e)
		{
			if (e.RemovalLength != 1 || textEditorData.Document.CurrentAtomicUndoOperationType == OperationType.Format) {
				return;
			}
			stateTracker.UpdateEngine (Math.Min (textEditorData.Document.TextLength, e.Offset + e.InsertionLength + 1));
			if (wasInVerbatimString && !stateTracker.Engine.IsInsideVerbatimString) {
				textEditorData.Document.TextReplacing -= HandleTextReplacing;
				textEditorData.Document.TextReplaced -= HandleTextReplaced;;
				ConvertVerbatimStringToNormal (textEditorData, e.Offset + e.InsertionLength + 1);
				textEditorData.Document.TextReplacing += HandleTextReplacing;
				textEditorData.Document.TextReplaced += HandleTextReplaced;;
			}
		}
开发者ID:jrhtcg,项目名称:monodevelop,代码行数:14,代码来源:CSharpTextEditorIndentation.cs

示例11: EditorDocumentTextReplacing

			/// <summary>
			/// Marks necessary lines modified when text is replaced
			/// </summary>
			private void EditorDocumentTextReplacing (object sender, DocumentChangeEventArgs e)
			{
				int startLine = widget.Editor.Document.OffsetToLineNumber (e.Offset),
					endLine = widget.Editor.Document.OffsetToLineNumber (e.Offset + Math.Max (e.RemovalLength, e.InsertionLength)),
					lineCount = 0;
				string[] tokens = null;
				
				if (startLine < endLine) {
					// change crosses line boundary
					
					lineCount = endLine - startLine;
					lineCount = Math.Min (lineCount, annotations.Count - startLine);
					
					if (lineCount > 0)
						annotations.RemoveRange (startLine - 1, lineCount);
					if (!string.IsNullOrEmpty (e.InsertedText.Text)) {
						for (int i=0; i<lineCount; ++i)
							annotations.Insert (startLine - 1, locallyModified);
					}
					return;
				} else if (0 == e.RemovalLength) {
					// insert
					tokens = e.InsertedText.Text.Split (new string[]{Environment.NewLine}, StringSplitOptions.None);
						lineCount = tokens.Length - 1;
						for (int i=0; i<lineCount; ++i) {
							annotations.Insert (Math.Min (startLine, annotations.Count), locallyModified);
						}
				} else if (startLine > endLine) {
					// revert
					UpdateAnnotations (null, null);
					return;
				}
				
				SetAnnotation (startLine, locallyModified);
			}
开发者ID:halleyxu,项目名称:monodevelop,代码行数:38,代码来源:BlameWidget.cs

示例12: HandleDataDocumentTextReplaced

		void HandleDataDocumentTextReplaced (object sender, DocumentChangeEventArgs e)
		{
			var data = dict [(TextDocument)sender];
			localUpdate.Remove (data);
			var editor = info.Document.GetContent<IEditableTextFile> ();
			editor.DeleteText (e.Offset, e.RemovalLength);
			editor.InsertText (e.Offset, e.InsertedText.Text);
			localUpdate.Add (data);
			UpdateDiff ();
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:10,代码来源:EditorCompareWidgetBase.cs

示例13: OnTextReplacing

		void OnTextReplacing (object sender, DocumentChangeEventArgs e)
		{
			if (lastChange == null)
				lastChange = new ChangeInfo (e.Offset, new SeekableTextReader((sender as TextDocument).Text));
			if (e.ChangeDelta > 0) {
				lastChange.Length += e.InsertionLength;
			} else {
				lastChange.Length -= e.RemovalLength;
			}
		}
开发者ID:brantwedel,项目名称:monodevelop,代码行数:10,代码来源:RazorCSharpParser.cs

示例14: BufferChanged

		private void BufferChanged (object sender, DocumentChangeEventArgs args)
		{
			if (TextChanged != null)
				TextChanged (this, EventArgs.Empty);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:5,代码来源:SqlEditorWidget.cs

示例15: HandleTextReplaced

		void HandleTextReplaced (object sender, DocumentChangeEventArgs e)
		{
			caret.UpdateCaretPosition ();
		}
开发者ID:dodev,项目名称:monodevelop,代码行数:4,代码来源:TextEditorData.cs


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