Beispiel #1
0
        public static void ATTRIBUTE(TypeMember type, params object[] constructorArgumentsAndBody)
        {
            var context   = GetContextOrThrow();
            var attribute = FluentHelpers.BuildAttribute(context, type, constructorArgumentsAndBody);

            if (context.TryPeekState <ParameterContext>(out var parameterContext))
            {
                parameterContext.Parameter.Attributes.Add(attribute);
            }
            else
            {
                var member = context.GetCurrentMember();
                member.Attributes.Add(attribute);
            }
        }
Beispiel #2
0
 public TypeMember INTERFACE(IdentifierName name, Action body)
 => FluentHelpers.BuildTypeMember(TypeMemberKind.Interface, name, body);
Beispiel #3
0
 public TypeMember STRUCT(IdentifierName name, Action body)
 => FluentHelpers.BuildTypeMember(TypeMemberKind.Struct, name, body);
Beispiel #4
0
 public TypeMember CLASS(IdentifierName name, Action body)
 => FluentHelpers.BuildTypeMember(TypeMemberKind.Class, name, body);