Esempio n. 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);
            }
        }
Esempio n. 2
0
 public TypeMember INTERFACE(IdentifierName name, Action body)
 => FluentHelpers.BuildTypeMember(TypeMemberKind.Interface, name, body);
Esempio n. 3
0
 public TypeMember STRUCT(IdentifierName name, Action body)
 => FluentHelpers.BuildTypeMember(TypeMemberKind.Struct, name, body);
Esempio n. 4
0
 public TypeMember CLASS(IdentifierName name, Action body)
 => FluentHelpers.BuildTypeMember(TypeMemberKind.Class, name, body);