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

Removed stale code and added more comments

上级 f5620799
......@@ -21,21 +21,17 @@ 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.Predecessor because we want the tag to be associated with the preceding character
/// </summary>
/// <param name="text">The name of the parameter associated with the argument</param>
public InlineParameterNameHintsTag(string text, IWpfTextView textView, TextFormattingRunProperties format)
: base(CreateElement(text, textView, format), removalCallback: AdornmentCallbackFunction, PositionAffinity.Predecessor)
: base(CreateElement(text, textView, format), removalCallback: null, PositionAffinity.Predecessor)
{
}
private static void AdornmentCallbackFunction(object tag, UIElement element)
{
//
}
private static UIElement CreateElement(string text, IWpfTextView textView, TextFormattingRunProperties format)
{
// Constructs the hint block which gets assigned parameter name and fontstyles according to the options
......@@ -63,12 +59,14 @@ private static UIElement CreateElement(string text, IWpfTextView textView, TextF
HorizontalAlignment = HorizontalAlignment.Center,
Margin = new Thickness(0, -0.20 * textView.LineHeight, 5, 0),
Padding = new Thickness(1),
// Need to set SnapsToDevicePixels and UseLayoutRounding to avoid unnecessary reformatting
SnapsToDevicePixels = textView.VisualElement.SnapsToDevicePixels,
UseLayoutRounding = textView.VisualElement.UseLayoutRounding,
VerticalAlignment = VerticalAlignment.Center
};
// Need to set these properties to avoid unecessary reformatting because some dependancy properties
// Need to set these properties to avoid unnecessary reformatting because some dependancy properties
// affect layout
TextOptions.SetTextFormattingMode(border, TextOptions.GetTextFormattingMode(textView.VisualElement));
TextOptions.SetTextHintingMode(border, TextOptions.GetTextHintingMode(textView.VisualElement));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册