private string GetDirectiveText()

in Backend/Core/ForTea.Core/Services/CodeStructure/T4CodeStructureDirective.cs [22:52]


    private string GetDirectiveText()
    {
      IT4Directive directive = GetTreeNode();
      string name = directive?.Name?.GetText();
      if (name == null)
        return "???";

      DirectiveInfo directiveInfo = T4DirectiveInfoManager.GetDirectiveByName(name);
      if (directiveInfo == null)
        return name;

      // display the directive with the attributes that are marked with DisplayInCodeStructure
      var builder = new StringBuilder(name);
      foreach (IT4DirectiveAttribute attribute in directive.AttributesEnumerable)
      {
        DirectiveAttributeInfo attributeInfo = directiveInfo.GetAttributeByName(attribute.Name.GetText());
        if (attributeInfo?.IsDisplayedInCodeStructure != true)
          continue;

        builder.Append(' ');
        builder.Append(attributeInfo.Name);
        if (attribute.Value != null)
        {
          builder.Append("=\"");
          builder.Append(attribute.Value.GetText());
          builder.Append('"');
        }
      }

      return builder.ToString();
    }