当前位置: 首页>>代码示例>>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;未经允许,请勿转载。