src/T4Toolbox.TemplateAnalysis/Directive.cs
/// <summary>
/// Extends the default behavior to return value of the <see cref="DescriptionAttribute"/> applied to a
/// directive property when its <see cref="Attribute"/> contains the specified <paramref name="position"/>.
/// </summary>
Extends the default behavior to return value of the  applied to a
directive property when its  contains the specified .
Extends the default behavior to return value of the applied to a directive property when its contains the specified .
public override bool TryGetDescription(int position, out string description, out Span applicableTo)
        {
            if (this.start.TryGetDescription(position, out description, out applicableTo))
            {
                return true;
            }
            if (this.name.Span.Contains(position) && base.TryGetDescription(position, out description, out applicableTo))
            {
                applicableTo = this.name.Span;
                return true;
            }
            IReadOnlyDictionary<string, PropertyDescriptor> properties = this.GetProperties();
            foreach (Attribute attribute in this.Attributes.Values)
            {
                PropertyDescriptor property;
                if (attribute.Span.Contains(position) && properties.TryGetValue(attribute.Name, out property))
                {
                    description = property.Description;
                    if (!string.IsNullOrEmpty(description))
                    {
                        applicableTo = attribute.Span;
                        return true;
                    }
                }
            }
            if (this.end.TryGetDescription(position, out description, out applicableTo))
            {
                return true;
            }
            description = string.Empty;
            applicableTo = default(Span);
            return false;
        }
public override bool TryGetDescription ( int position , out string description , out Span applicableTo ) { if ( this . start . TryGetDescription ( position , out description , out applicableTo ) ) { return true ; } if ( this . name . Span . Contains ( position ) && base . TryGetDescription ( position , out description , out applicableTo ) ) { applicableTo = this . name . Span ; return true ; } IReadOnlyDictionary < string , PropertyDescriptor > properties = this . GetProperties ( ) ; foreach ( Attribute attribute in this . Attributes . Values ) { PropertyDescriptor property ; if ( attribute . Span . Contains ( position ) && properties . TryGetValue ( attribute . Name , out property ) ) { description = property . Description ; if ( ! string . IsNullOrEmpty ( description ) ) { applicableTo = attribute . Span ; return true ; } } } if ( this . end . TryGetDescription ( position , out description , out applicableTo ) ) { return true ; } description = string . Empty ; applicableTo = default ( Span ) ; return false ; }
Extends the default behavior to return value of the  applied to a
directive property when its  contains the specified .
Extends the default behavior to return value of the applied to a directive property when its contains the specified .
// Block start returns its own description // Name returns description of the parent directive // Attributes return description of their respective properties // Block end returns its own description // No description for gaps between children to prevent directive's tooltip from sticking during horizontal mouse movement and blocking childrens' tooltips.
position
int
string
out
Span
out