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


C# SourceEditor.MessageBubbleCache类代码示例

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


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

示例1: MessageBubblePopoverWindow

			public MessageBubblePopoverWindow (MessageBubbleCache cache, MessageBubbleTextMarker marker)
			{
				this.cache = cache;
				this.marker = marker;
				ShowArrow = true;
				Opacity = 0.9;
			}
开发者ID:xiexin36,项目名称:monodevelop,代码行数:7,代码来源:MessageBubbleCache.cs

示例2: UpdateTasks

		void UpdateTasks (object sender, TaskEventArgs e)
		{
			Task[] tasks = TaskService.Errors.GetFileTasks (ContentName);
			if (tasks == null)
				return;
			DisposeErrorMarkers (); // disposes messageBubbleCache as well.
			if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.Never)
				return;
			using (var undo = Document.OpenUndoGroup ()) {
				if (messageBubbleCache != null)
					messageBubbleCache.Dispose ();
				messageBubbleCache = new MessageBubbleCache (widget.TextEditor);
				
				foreach (Task task in tasks) {
					if (task.Severity == TaskSeverity.Error || task.Severity == TaskSeverity.Warning) {
						if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.ForErrors && task.Severity == TaskSeverity.Warning)
							continue;
						DocumentLine lineSegment = widget.Document.GetLine (task.Line);
						if (lineSegment == null)
							continue;
						var marker = currentErrorMarkers.FirstOrDefault (m => m.LineSegment == lineSegment);
						if (marker != null) {
							marker.AddError (task.Severity == TaskSeverity.Error, task.Description);
							continue;
						}
						MessageBubbleTextMarker errorTextMarker = new MessageBubbleTextMarker (messageBubbleCache, task, lineSegment, task.Severity == TaskSeverity.Error, task.Description);
						currentErrorMarkers.Add (errorTextMarker);
						
						errorTextMarker.IsVisible =  !IdeApp.Preferences.DefaultHideMessageBubbles;
						widget.Document.AddMarker (lineSegment, errorTextMarker, false);
					}
				}
			}
			widget.TextEditor.QueueDraw ();
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:35,代码来源:SourceEditorView.cs

示例3: MessageBubbleTextMarker

		internal MessageBubbleTextMarker (MessageBubbleCache cache, Task task, DocumentLine lineSegment, bool isError, string errorMessage)
		{
			if (cache == null)
				throw new ArgumentNullException ("cache");
			this.cache = cache;
			this.task = task;
			this.IsVisible = true;
			this.lineSegment = lineSegment;
			this.initialText = editor.Document.GetTextAt (lineSegment);
			this.isError = isError;
			AddError (task, isError, errorMessage);
//			cache.Changed += (sender, e) => CalculateLineFit (editor, lineSegment);
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:13,代码来源:MessageBubbleTextMarker.cs

示例4: MessageBubblePopoverWindow

			public MessageBubblePopoverWindow (MessageBubbleCache cache, MessageBubbleTextMarker marker)
			{
				this.cache = cache;
				this.marker = marker;
				ShowArrow = true;
				Theme.ArrowLength = 7;
				TransientFor = IdeApp.Workbench.RootWindow;
			}
开发者ID:kdubau,项目名称:monodevelop,代码行数:8,代码来源:MessageBubbleCache.cs

示例5: UpdateTasks

		void UpdateTasks (object sender, TaskEventArgs e)
		{
			TaskListEntry [] tasks = TaskService.Errors.GetFileTasks (ContentName);
			if (tasks == null)
				return;
			DisposeErrorMarkers (); // disposes messageBubbleCache as well.
			if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.Never)
				return;
			messageBubbleCache = new MessageBubbleCache (widget.TextEditor);
			CancelMessageBubbleUpdate ();
			var token = messageBubbleUpdateSource;

			Task.Run (delegate {
				var errorMarkers = new List<MessageBubbleTextMarker> ();
				foreach (TaskListEntry task in tasks) {
					if (token.IsCancellationRequested)
						return null;
					if (task.Severity == TaskSeverity.Error || task.Severity == TaskSeverity.Warning) {
						if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.ForErrors && task.Severity == TaskSeverity.Warning)
							continue;
						var errorTextMarker = new MessageBubbleTextMarker (messageBubbleCache, task, task.Severity == TaskSeverity.Error, task.Description);
						errorMarkers.Add (errorTextMarker);

						errorTextMarker.IsVisible = !IdeApp.Preferences.DefaultHideMessageBubbles;
					}
				}
				return errorMarkers;
			}).ContinueWith (t => {
				if (token.IsCancellationRequested)
					return;
				Application.Invoke (delegate {
					if (token.IsCancellationRequested)
						return;
					var newErrorMarkers = new List<MessageBubbleTextMarker> ();
					foreach (var marker in t.Result) {
						if (token.IsCancellationRequested)
							return;
						var lineSegment = widget.Document.GetLine (marker.Task.Line);
						if (lineSegment == null)
							continue;
						var oldMarker = lineSegment.Markers.OfType<MessageBubbleTextMarker> ().FirstOrDefault ();
						if (oldMarker != null) {
							oldMarker.AddError (marker.Task, marker.Task.Severity == TaskSeverity.Error, marker.Task.Description);
						} else {
							marker.LineSegment = lineSegment;
							widget.Document.AddMarker (lineSegment, marker, false);
							newErrorMarkers.Add (marker);
						}
					}
					this.currentErrorMarkers = newErrorMarkers;
				});
			});
		}
开发者ID:stephenoakman,项目名称:monodevelop,代码行数:53,代码来源:SourceEditorView.cs

示例6: MessageBubbleTextMarker

		internal MessageBubbleTextMarker (MessageBubbleCache cache, Task task, LineSegment lineSegment, bool isError, string errorMessage)
		{
			this.cache = cache;
			this.task = task;
			this.IsVisible = true;
			this.lineSegment = lineSegment;
			this.initialText = editor.Document.GetTextAt (lineSegment);
			this.Flags = TextMarkerFlags.DrawsSelection;
			AddError (isError, errorMessage);
//			cache.Changed += (sender, e) => CalculateLineFit (editor, lineSegment);
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:11,代码来源:MessageBubbleTextMarker.cs

示例7: MessageBubbleTextMarker

		internal MessageBubbleTextMarker (MessageBubbleCache cache, TaskListEntry task, bool isError, string errorMessage)
		{
			if (cache == null)
				throw new ArgumentNullException ("cache");
			this.cache = cache;
			this.task = task;
			this.isError = isError;
			AddError (task, isError, errorMessage);
//			cache.Changed += (sender, e) => CalculateLineFit (editor, lineSegment);
		}
开发者ID:ArsenShnurkov,项目名称:monodevelop,代码行数:10,代码来源:MessageBubbleTextMarker.cs

示例8: DisposeErrorMarkers

		void DisposeErrorMarkers ()
		{
			//the window has a reference to the markers we're destroying
			//so if the error markers get cleared out while it's running, its expose will
			//NRE and bring down MD
			if (messageBubbleHighlightPopupWindow != null)
				messageBubbleHighlightPopupWindow.Destroy ();
			
			currentErrorMarkers.ForEach (em => {
				widget.Document.RemoveMarker (em);
				em.Dispose ();
			});
			currentErrorMarkers.Clear ();
			if (messageBubbleCache != null) {
				messageBubbleCache.Dispose ();
				messageBubbleCache = null;
			}
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:18,代码来源:SourceEditorView.cs


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