public override Control GetVisualizerWidget(ObjectValue val) { string value = val.Value; Gdk.Color col = new Gdk.Color(85, 85, 85); if (!val.IsNull && (val.TypeName == "string" || val.TypeName == "char[]")) { value = '"' + GetString(val) + '"'; } if (DebuggingService.HasInlineVisualizer(val)) { value = DebuggingService.GetInlineVisualizer(val).InlineVisualize(val); } var label = new Gtk.Label(); label.Text = value; var font = label.Style.FontDescription.Copy(); if (font.SizeIsAbsolute) { font.AbsoluteSize = font.Size - 1; } else { font.Size -= (int)(Pango.Scale.PangoScale); } label.ModifyFont(font); label.ModifyFg(StateType.Normal, col); label.SetPadding(4, 4); if (label.SizeRequest().Width > 500) { label.WidthRequest = 500; label.Wrap = true; label.LineWrapMode = Pango.WrapMode.WordChar; } else { label.Justify = Gtk.Justification.Center; } if (label.Layout.GetLine(1) != null) { label.Justify = Gtk.Justification.Left; var line15 = label.Layout.GetLine(15); if (line15 != null) { label.Text = value.Substring(0, line15.StartIndex).TrimEnd('\r', '\n') + "\n…"; } } label.Show(); return(label); }
public override Control GetVisualizerWidget(ObjectValue val) { var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone(); ops.AllowTargetInvoke = true; ops.ChunkRawStrings = true; ops.EllipsizedLength = 5000; //Preview window can hold aprox. 4700 chars val.Refresh(ops); //Refresh DebuggerDisplay/String value with full length instead of ellipsized string value = val.Value; Gdk.Color col = Styles.PreviewVisualizerTextColor.ToGdkColor(); if (DebuggingService.HasInlineVisualizer(val)) { value = DebuggingService.GetInlineVisualizer(val).InlineVisualize(val); } var label = new Gtk.Label(); label.Text = value; label.ModifyFont(FontService.SansFont.CopyModified(Ide.Gui.Styles.FontScale11)); label.ModifyFg(StateType.Normal, col); label.SetPadding(4, 4); if (label.SizeRequest().Width > 500) { label.WidthRequest = 500; label.Wrap = true; label.LineWrapMode = Pango.WrapMode.WordChar; } else { label.Justify = Gtk.Justification.Center; } if (label.Layout.GetLine(1) != null) { label.Justify = Gtk.Justification.Left; var trimmedLine = label.Layout.GetLine(50); if (trimmedLine != null) { label.Text = value.Substring(0, trimmedLine.StartIndex).TrimEnd('\r', '\n') + "\n…"; } } label.Selectable = true; label.CanFocus = false; label.Show(); return(label); }
public override Control GetVisualizerWidget(ObjectValue val) { string value = val.Value; Gdk.Color col = Styles.PreviewVisualizerTextColor.ToGdkColor(); if (!val.IsNull && (val.TypeName == "string" || val.TypeName == "char[]")) { value = '"' + GetString(val) + '"'; } if (DebuggingService.HasInlineVisualizer(val)) { value = DebuggingService.GetInlineVisualizer(val).InlineVisualize(val); } var label = new Gtk.Label(); label.Text = value; label.ModifyFont(FontService.SansFont.CopyModified(Ide.Gui.Styles.FontScale11)); label.ModifyFg(StateType.Normal, col); label.SetPadding(4, 4); if (label.SizeRequest().Width > 500) { label.WidthRequest = 500; label.Wrap = true; label.LineWrapMode = Pango.WrapMode.WordChar; } else { label.Justify = Gtk.Justification.Center; } if (label.Layout.GetLine(1) != null) { label.Justify = Gtk.Justification.Left; var line15 = label.Layout.GetLine(15); if (line15 != null) { label.Text = value.Substring(0, line15.StartIndex).TrimEnd('\r', '\n') + "\n…"; } } label.Show(); return(label); }