當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。