提交 c12bacad 编写于 作者: A Ankita Khera

Made some minor changes

上级 b7966986
......@@ -19,6 +19,7 @@ namespace Microsoft.CodeAnalysis.Editor.InlineParameterNameHints
internal class InlineParameterNameHintsTag : IntraTextAdornmentTag
{
public const string TagId = "inline parameter name hints";
/// <summary>
/// Creates the UIElement on call
/// Uses PositionAffinity.Successor because we want the tag to be associated with the following character
......@@ -31,26 +32,26 @@ public InlineParameterNameHintsTag(string text, double lineHeight, TextFormattin
private static UIElement CreateElement(string text, double lineHeight, TextFormattingRunProperties format)
{
// Constructs the hint block which gets assigned parameter name, a normal fontstyle, and sets the padding
// space around the block to 0
// Constructs the hint block which gets assigned parameter name and nested inside a border where the
// attributes of the block are received from the options menu
var block = new TextBlock
{
Text = text + ":",
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
FontStyle = FontStyles.Normal,
FontFamily = format.Typeface.FontFamily, //new System.Windows.Media.FontFamily("Consolas"),
FontFamily = format.Typeface.FontFamily,
FontSize = format.FontRenderingEmSize - 1,
Padding = new Thickness(0),
Background = format.BackgroundBrush,//System.Windows.Media.Brushes.Lavender,
Foreground = format.ForegroundBrush //System.Windows.Media.Brushes.Gray
Background = format.BackgroundBrush,
Foreground = format.ForegroundBrush
};
var border = new Border
{
CornerRadius = new CornerRadius(2),
Background = format.BackgroundBrush,//System.Windows.Media.Brushes.Lavender,
BorderBrush = format.BackgroundBrush, //System.Windows.Media.Brushes.Lavender,
Background = format.BackgroundBrush,
BorderBrush = format.BackgroundBrush,
BorderThickness = new Thickness(1),
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center,
......@@ -61,8 +62,6 @@ private static UIElement CreateElement(string text, double lineHeight, TextForma
block.Measure(new System.Windows.Size(double.PositiveInfinity, double.PositiveInfinity));
border.Measure(new System.Windows.Size(double.PositiveInfinity, double.PositiveInfinity));
return border;
//return block;
}
}
}
......@@ -67,8 +67,7 @@ private TextFormattingRunProperties Format
{
get
{
if (_format == null)
_format = _formatMap.GetTextProperties(_keyword);
_format ??= _formatMap.GetTextProperties(_keyword);
return _format;
}
......
......@@ -30,8 +30,8 @@ internal class InlineParameterNameHintsTaggerProvider : IViewTaggerProvider
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public InlineParameterNameHintsTaggerProvider(IBufferTagAggregatorFactoryService bufferTagAggregatorFactoryService,
[Import] IClassificationFormatMapService classificationFormatMapService,
[Import] IClassificationTypeRegistryService classificationTypeRegistryService)
IClassificationFormatMapService classificationFormatMapService,
IClassificationTypeRegistryService classificationTypeRegistryService)
{
_bufferTagAggregatorFactoryService = bufferTagAggregatorFactoryService;
this.ClassificationFormatMapService = classificationFormatMapService;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册