/// <summary> /// Creates a new ContractAdornment for the given method (specified by the tag). /// </summary> public ContractAdornment(ITrackingSpan span, VSTextProperties vsTextProperties, Logger logger, Action queueRefreshLineTransfomer, AdornmentOptions options = AdornmentOptions.None) { Contract.Requires(span != null); Contract.Requires(logger != null); _logger = logger; Span = span; InitializeComponent(); _queueRefreshLineTransformer = queueRefreshLineTransfomer; Visibility = Visibility.Collapsed; _vsTextProperties = vsTextProperties; for (int i = 0; i < vsTextProperties.TabSize; i++) { _tabsAsSpaces += " "; } _options = options; LayoutUpdated += OnLayoutUpdated; IsVisibleChanged += OnVisibilityChanged; Visual.MouseEnter += OnMouseEnter; Visual.MouseLeave += OnMouseLeave; int size = (int)vsTextProperties.FontSize; /* * if (size <= 9) size = 8; * else if (size == 10) size = 9; * else size = size - 2; */ rootGrid.SetValue(TextBlock.FontSizeProperty, (double)size); SetVisual(); }
public MetadataContractAdornment(ITrackingSpan span, VSTextProperties vsTextProperties, Logger logger, Action queueRefreshLineTransfomer, AdornmentOptions options = AdornmentOptions.None) : base(span, vsTextProperties, logger, queueRefreshLineTransfomer, options) { Contract.Requires(span != null); Contract.Requires(logger != null); SizeChanged += OnSizeChanged; }
/// <summary> /// Creates a new ContractAdornment for the given method (specified by the tag). /// </summary> public ContractAdornment(ITrackingSpan span, VSTextProperties vsTextProperties, Logger logger, Action queueRefreshLineTransfomer, AdornmentOptions options = AdornmentOptions.None) { Contract.Requires(span != null); Contract.Requires(logger != null); _logger = logger; Span = span; InitializeComponent(); _queueRefreshLineTransformer = queueRefreshLineTransfomer; Visibility = Visibility.Collapsed; _vsTextProperties = vsTextProperties; for (int i = 0; i < vsTextProperties.TabSize; i++) { _tabsAsSpaces += " "; } _options = options; LayoutUpdated += OnLayoutUpdated; IsVisibleChanged += OnVisibilityChanged; Visual.MouseEnter += OnMouseEnter; Visual.MouseLeave += OnMouseLeave; int size = (int)vsTextProperties.FontSize; /* if (size <= 9) size = 8; else if (size == 10) size = 9; else size = size - 2; */ rootGrid.SetValue(TextBlock.FontSizeProperty, (double)size); SetVisual(); }