QuickTaskSeverity DrawQuickTasks(Cairo.Context cr) { QuickTaskSeverity severity = QuickTaskSeverity.None; int h = Allocation.Height - Allocation.Width - 6; foreach (var task in AllTasks) { double y = h * TextEditor.LineToY(task.Location.Line) / Math.Max(TextEditor.EditorLineThreshold * TextEditor.LineHeight + TextEditor.GetTextEditorData().TotalHeight, TextEditor.Allocation.Height); var color = (HslColor)GetBarColor(task.Severity); cr.Color = color; cr.Rectangle(3, y - 1, Allocation.Width - 5, 4); cr.FillPreserve(); color.L *= 0.7; cr.Color = color; cr.Rectangle(3, y - 1, Allocation.Width - 5, 4); cr.Stroke(); switch (task.Severity) { case QuickTaskSeverity.Error: severity = QuickTaskSeverity.Error; break; case QuickTaskSeverity.Warning: if (severity == QuickTaskSeverity.None) { severity = QuickTaskSeverity.Warning; } break; } } return(severity); }
public Result(DomRegion region, string message, QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance, bool underline = true) { this.Region = region; this.Message = message; this.Level = level; this.Certainty = certainty; this.Importance = importance; this.Underline = underline; }
public Result (DomRegion region, string message, QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance, bool underline = true) { this.Region = region; this.Message = message; this.Level = level; this.Certainty = certainty; this.Importance = importance; this.Underline = underline; }
Cairo.Color GetIndicatorColor(QuickTaskSeverity severity) { switch (severity) { case QuickTaskSeverity.Error: return(new Cairo.Color(254 / 255.0, 58 / 255.0, 22 / 255.0)); case QuickTaskSeverity.Warning: return(new Cairo.Color(251 / 255.0, 247 / 255.0, 88 / 255.0)); default: return(new Cairo.Color(75 / 255.0, 255 / 255.0, 75 / 255.0)); } }
static string GetIcon(QuickTaskSeverity severity) { switch (severity) { case QuickTaskSeverity.Error: return(Gtk.Stock.DialogError); case QuickTaskSeverity.Warning: return(Gtk.Stock.DialogWarning); case QuickTaskSeverity.Hint: return(Gtk.Stock.Info); default: return(null); } }
string GetDescription (QuickTaskSeverity severity) { switch (severity) { case QuickTaskSeverity.None: return GettextCatalog.GetString ("Do not show"); case QuickTaskSeverity.Error: return GettextCatalog.GetString ("Error"); case QuickTaskSeverity.Warning: return GettextCatalog.GetString ("Warning"); case QuickTaskSeverity.Hint: return GettextCatalog.GetString ("Hint"); case QuickTaskSeverity.Suggestion: return GettextCatalog.GetString ("Suggestion"); default: throw new ArgumentOutOfRangeException (); } }
void DrawIndicator(Cairo.Context cr, QuickTaskSeverity severity) { cr.Rectangle(3, Allocation.Height - Allocation.Width + 3, Allocation.Width - 6, Allocation.Width - 6); var darkColor = (HslColor)GetIndicatorColor(severity); darkColor.L *= 0.5; using (var pattern = new Cairo.LinearGradient(0, 0, Allocation.Width - 3, Allocation.Width - 3)) { pattern.AddColorStop(0, darkColor); pattern.AddColorStop(1, GetIndicatorColor(severity)); cr.Pattern = pattern; cr.FillPreserve(); } cr.Color = darkColor; cr.Stroke(); }
string GetDescription(QuickTaskSeverity severity) { switch (severity) { case QuickTaskSeverity.None: return(GettextCatalog.GetString("Do not show")); case QuickTaskSeverity.Error: return(GettextCatalog.GetString("Error")); case QuickTaskSeverity.Warning: return(GettextCatalog.GetString("Warning")); case QuickTaskSeverity.Hint: return(GettextCatalog.GetString("Hint")); case QuickTaskSeverity.Suggestion: return(GettextCatalog.GetString("Suggestion")); default: throw new ArgumentOutOfRangeException(); } }
Cairo.Color GetBarColor(QuickTaskSeverity severity) { switch (severity) { case QuickTaskSeverity.Error: return(TextEditor.ColorStyle.ErrorUnderline); case QuickTaskSeverity.Warning: return(TextEditor.ColorStyle.WarningUnderline); case QuickTaskSeverity.Suggestion: return(TextEditor.ColorStyle.SuggestionUnderline); case QuickTaskSeverity.Hint: return(TextEditor.ColorStyle.HintUnderline); case QuickTaskSeverity.None: return(TextEditor.ColorStyle.Default.CairoColor); default: throw new ArgumentOutOfRangeException(); } }
public GenericResults (DomRegion region, string message, QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance, params GenericFix[] fixes) : base (region, message, level, certainty, importance) { this.Fixes = fixes; }
public void SetSeverity(QuickTaskSeverity severity) { PropertyService.Set("refactoring.inspectors." + MimeType + "." + Type.FullName, severity); }
public QuickTask (string description, DomLocation location, QuickTaskSeverity severity) { this.Description = description; this.Location = location; this.Severity = severity; }
Cairo.Color GetIndicatorColor (QuickTaskSeverity severity) { switch (severity) { case QuickTaskSeverity.Error: return new Cairo.Color (254 / 255.0, 58 / 255.0, 22 / 255.0); case QuickTaskSeverity.Warning: return new Cairo.Color (251 / 255.0, 247 / 255.0, 88 / 255.0); default: return new Cairo.Color (75 / 255.0, 255 / 255.0, 75 / 255.0); } }
public QuickTask(string description, DomLocation location, QuickTaskSeverity severity) { this.Description = description; this.Location = location; this.Severity = severity; }
public void SetSeverity(QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance) { this.Level = level; this.Certainty = certainty; this.Importance = importance; }
Cairo.Color GetBarColor (QuickTaskSeverity severity) { switch (severity) { case QuickTaskSeverity.Error: return TextEditor.ColorStyle.ErrorUnderline; case QuickTaskSeverity.Warning: return TextEditor.ColorStyle.WarningUnderline; case QuickTaskSeverity.Suggestion: return TextEditor.ColorStyle.SuggestionUnderline; case QuickTaskSeverity.Hint: return TextEditor.ColorStyle.HintUnderline; case QuickTaskSeverity.None: return TextEditor.ColorStyle.Default.CairoColor; default: throw new ArgumentOutOfRangeException (); } }
public void SetSeverity (QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance) { this.Level = level; this.Certainty = certainty; this.Importance = importance; }
void DrawIndicator (Cairo.Context cr, QuickTaskSeverity severity) { cr.Rectangle (3, Allocation.Height - Allocation.Width + 3, Allocation.Width - 6, Allocation.Width - 6); var darkColor = (HslColor)GetIndicatorColor (severity); darkColor.L *= 0.5; using (var pattern = new Cairo.LinearGradient (0, 0, Allocation.Width - 3, Allocation.Width - 3)) { pattern.AddColorStop (0, darkColor); pattern.AddColorStop (1, GetIndicatorColor (severity)); cr.Pattern = pattern; cr.FillPreserve (); } cr.Color = darkColor; cr.Stroke (); }
public void SetSeverity (QuickTaskSeverity severity) { PropertyService.Set ("refactoring.inspectors." + MimeType + "." + Type.FullName, severity); }
static string GetIcon (QuickTaskSeverity severity) { switch (severity) { case QuickTaskSeverity.Error: return Gtk.Stock.DialogError; case QuickTaskSeverity.Warning: return Gtk.Stock.DialogWarning; case QuickTaskSeverity.Hint: return Gtk.Stock.Info; default: return null; } }
public FixableResult(DomRegion region, string message, QuickTaskSeverity level, ResultCertainty certainty, ResultImportance importance, params IAnalysisFix[] fixes) : base(region, message, level, certainty, importance) { this.Fixes = fixes; }