• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# TextEditor.ReplaceEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: HandleDataDocumentTextReplaced

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


示例17: HandleInfoDocumentTextEditorDataDocumentTextReplaced

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


示例18: UndoOperation

			public UndoOperation (ReplaceEventArgs args, string text)
			{
				this.args = args;
				this.text = text;
			}
开发者ID:kangaroo,项目名称:monodevelop,代码行数:5,代码来源:Document.cs


示例19: HandleTextReplaced

		void HandleTextReplaced (object sender, ReplaceEventArgs e)
		{
			RemoveCachedLine (Document.GetLineByOffset (e.Offset));
			if (mouseSelectionMode == MouseSelectionMode.Word && e.Offset < mouseWordStart) {
				int delta = -e.Count;
				if (!string.IsNullOrEmpty (e.Value))
					delta += e.Value.Length;
				mouseWordStart += delta;
				mouseWordEnd += delta;
			}
			
			if (selectedRegions.Count > 0) {
				List<ISegment> newRegions = new List<ISegment> (this.selectedRegions);
				Document.UpdateSegments (newRegions, e);
				this.selectedRegions = newRegions;
				RefreshSearchMarker ();
			}
		}
开发者ID:aleksandersumowski,项目名称:monodevelop,代码行数:18,代码来源:TextViewMargin.cs


示例20: GetDelta

			static int GetDelta (ReplaceEventArgs args)
			{
				int result = -args.Count;
				if (!String.IsNullOrEmpty (args.Value))
					result += args.Value.Length;
				return result;
			}
开发者ID:kangaroo,项目名称:monodevelop,代码行数:7,代码来源:Document.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TextEditor.TextDocument类代码示例发布时间:2022-05-26
下一篇:
C# TextEditor.MarginMouseEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap