當前位置: 首頁>>代碼示例>>C#>>正文


C# TextEditor.ReplaceEventArgs類代碼示例

本文整理匯總了C#中Mono.TextEditor.ReplaceEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# ReplaceEventArgs類的具體用法?C# ReplaceEventArgs怎麽用?C# ReplaceEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ReplaceEventArgs類屬於Mono.TextEditor命名空間,在下文中一共展示了ReplaceEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TextReplaced

		public void TextReplaced (object sender, ReplaceEventArgs args)
		{
			if (args.Count > 0)
				TextRemove (args.Offset, args.Count);
			if (args.Value != null && args.Value.Length > 0)
				TextInsert (args.Offset, args.Value);
		}
開發者ID:transformersprimeabcxyz,項目名稱:monodevelop-1,代碼行數:7,代碼來源:LineSplitter.cs

示例2: TextReplaced

		public void TextReplaced (object sender, ReplaceEventArgs args)
		{
			if (args.Count > 0)
				TextRemove (args.Offset, args.Count);
			if (!string.IsNullOrEmpty (args.Value))
				TextInsert (args.Offset, args.Value);
		}
開發者ID:Poiros,項目名稱:monodevelop,代碼行數:7,代碼來源:LineSplitter.cs

示例3: UpdateUndoStackOnReplace

		// The undo stack needs to be updated on replace, because the text editor
		// draws a replace operation marker at the left margin.
		public void UpdateUndoStackOnReplace (ReplaceEventArgs args)
		{
			foreach (UndoOperation op in undoStack) {
				op.InformTextReplace (args);
			}
			// since we're only displaying the undo stack it's not required to update the redo stack
//			foreach (UndoOperation op in redoStack) {
//				op.InformTextReplace (args);
//			}
		}
開發者ID:kangaroo,項目名稱:monodevelop,代碼行數:12,代碼來源:Document.cs

示例4: BufferChanged

		private void BufferChanged (object sender, ReplaceEventArgs args)
		{
			if (TextChanged != null)
				TextChanged (this, EventArgs.Empty);
		}
開發者ID:nieve,項目名稱:monodevelop,代碼行數:5,代碼來源:SqlEditorWidget.cs

示例5: EditorDocumentTextReplacing

			/// <summary>
			/// Marks necessary lines modified when text is replaced
			/// </summary>
			private void EditorDocumentTextReplacing (object sender, ReplaceEventArgs e)
			{
				int  startLine = widget.Editor.Document.OffsetToLineNumber (e.Offset),
				     endLine = widget.Editor.Document.OffsetToLineNumber (e.Offset + Math.Max (e.Count, e.Value != null ? e.Value.Length : 0)),
				     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.Value)) {
						for (int i=0; i<lineCount; ++i)
							annotations.Insert (startLine - 1, locallyModified);
					}
					return;
				} else if (0 == e.Count) {
						// insert
						tokens = e.Value.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:trustme,項目名稱:monodevelop,代碼行數:38,代碼來源:BlameWidget.cs

示例6: OnTextReplacing

		void OnTextReplacing (object s, ReplaceEventArgs a)
		{
			if (a.Count > 0)  {
				oldReplaceText = widget.TextEditor.Document.GetTextAt (a.Offset, a.Count);
			} else {
				oldReplaceText = "";
			}
		}
開發者ID:stewartwhaley,項目名稱:monodevelop,代碼行數:8,代碼來源:SourceEditorView.cs

示例7: TextReplaced

		public void TextReplaced (object sender, ReplaceEventArgs args)
		{
			throw new NotSupportedException ("Operation not supported on this line splitter.");
		}
開發者ID:yayanyang,項目名稱:monodevelop,代碼行數:4,代碼來源:PrimitiveLineSplitter.cs

示例8: HandleDataDocumentTextReplaced

		void HandleDataDocumentTextReplaced (object sender, ReplaceEventArgs e)
		{
			var data = dict[(Document)sender];
			localUpdate.Remove (data);
			info.Document.Editor.Replace (e.Offset, e.Count, e.Value);
			localUpdate.Add (data);
			CreateDiff ();
		}
開發者ID:acken,項目名稱:monodevelop,代碼行數:8,代碼來源:ComparisonWidget.cs

示例9: OnTextReplacing

		protected virtual void OnTextReplacing (ReplaceEventArgs args)
		{
			if (TextReplacing != null)
				TextReplacing (this, args);
		}
開發者ID:kangaroo,項目名稱:monodevelop,代碼行數:5,代碼來源:Document.cs

示例10: InterruptFoldWorker

		void IBuffer.Replace (int offset, int count, string value)
		{
			if (atomicUndoLevel == 0) {
				if (this.syntaxMode != null && !SuppressHighlightUpdate)
					Mono.TextEditor.Highlighting.SyntaxModeService.WaitUpdate (this);
			}
			InterruptFoldWorker ();
			//			Mono.TextEditor.Highlighting.SyntaxModeService.WaitForUpdate (true);
			//			Debug.Assert (count >= 0);
			//			Debug.Assert (0 <= offset && offset + count <= Length);
			int oldLineCount = this.LineCount;
			var args = new ReplaceEventArgs (offset, count, value);
			if (Partitioner != null)
				Partitioner.TextReplacing (args);
			OnTextReplacing (args);
			value = args.Value;
			/* insert/repla
			lock (syncObject) {
				int endOffset = offset + count;
				foldSegments = new List<FoldSegment> (foldSegments.Where (s => (s.Offset < offset || s.Offset >= endOffset) && 
				                                                               (s.EndOffset <= offset || s.EndOffset >= endOffset)));
			}*/	
			UndoOperation operation = null;
			if (!isInUndo) {
				operation = new UndoOperation (args, count > 0 ? GetTextAt (offset, count) : "");
				if (currentAtomicOperation != null) {
					currentAtomicOperation.Add (operation);
				} else {
					OnBeginUndo ();
					undoStack.Push (operation);
					OnEndUndo (new UndoOperationEventArgs (operation));
				}
				redoStack.Clear ();
			}
			
			buffer.Replace (offset, count, value);
			foldSegmentTree.UpdateOnTextReplace (this, args);
			splitter.TextReplaced (this, args);
			if (Partitioner != null)
				Partitioner.TextReplaced (args);
			OnTextReplaced (args);
			
			UpdateUndoStackOnReplace (args);
			if (operation != null)
				operation.Setup (this, args);
			
			if (this.syntaxMode != null && !SuppressHighlightUpdate) {
				Mono.TextEditor.Highlighting.SyntaxModeService.StartUpdate (this, this.syntaxMode, offset, value != null ? offset + value.Length : offset + count);
			}
			if (oldLineCount != LineCount)
				this.CommitLineToEndUpdate (this.OffsetToLocation (offset).Line);
		}
開發者ID:kangaroo,項目名稱:monodevelop,代碼行數:52,代碼來源:Document.cs

示例11: UpdateSegments

		public static void UpdateSegments (IEnumerable<ISegment> segments, ReplaceEventArgs args)
		{
			int delta = -args.Count + (!string.IsNullOrEmpty (args.Value) ? args.Value.Length : 0);
			foreach (ISegment segment in segments) {
				if (args.Offset < segment.Offset) {
					segment.Offset += delta;
				} else if (args.Offset <= segment.EndOffset) {
					segment.Length += delta;
				}
			}
		}
開發者ID:kangaroo,項目名稱:monodevelop,代碼行數:11,代碼來源:Document.cs

示例12: TextReplaced

		public abstract void TextReplaced (ReplaceEventArgs args);
開發者ID:Tak,項目名稱:monodevelop-novell,代碼行數:1,代碼來源:AbstractPartitioner.cs

示例13: TextReplacing

		public virtual void TextReplacing (ReplaceEventArgs args)
		{
		}
開發者ID:Tak,項目名稱:monodevelop-novell,代碼行數:3,代碼來源:AbstractPartitioner.cs

示例14: UpdateConflictsOnTextReplace

		void UpdateConflictsOnTextReplace (object sender, ReplaceEventArgs e)
		{
			Document.UpdateSegments (GetAllConflictingSegments (), e);
		}
開發者ID:raufbutt,項目名稱:monodevelop-old,代碼行數:4,代碼來源:MergeWidget.cs

示例15: UpdateConflictsOnTextReplace

		void UpdateConflictsOnTextReplace (object sender, ReplaceEventArgs e)
		{
			this.UpdateDiff ();
			Mono.TextEditor.Document.UpdateSegments (GetAllConflictingSegments (), e);
		}
開發者ID:awatertree,項目名稱:monodevelop,代碼行數:5,代碼來源:MergeWidget.cs


注:本文中的Mono.TextEditor.ReplaceEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。