本文整理匯總了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;
}
示例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 ();
}
示例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);
}
示例4: MessageBubblePopoverWindow
public MessageBubblePopoverWindow (MessageBubbleCache cache, MessageBubbleTextMarker marker)
{
this.cache = cache;
this.marker = marker;
ShowArrow = true;
Theme.ArrowLength = 7;
TransientFor = IdeApp.Workbench.RootWindow;
}
示例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;
});
});
}
示例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);
}
示例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);
}
示例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;
}
}