예제 #1
0
 public static Property WithScope(this Property @this, ScopeModifier value) => new Property(@this.Name,
                                                                                            @this.Type,
                                                                                            documentation: @this.Documentation,
                                                                                            getter: @this.Getter,
                                                                                            setter: @this.Setter,
                                                                                            scope: value,
                                                                                            access: @this.Access);
예제 #2
0
파일: Field.cs 프로젝트: ycfft/CodeBuilder
 public Field(string name, IType type, bool isReadonly = false, ScopeModifier scope = ScopeModifier.Instance, AccessModifier access = AccessModifier.Private)
 {
     this.Type       = type;
     this.Name       = name;
     this.IsReadonly = isReadonly;
     this.Scope      = scope;
     this.Access     = access;
 }
예제 #3
0
 public Class(string name, string documentation = null, ScopeModifier scope = ScopeModifier.Instance, AccessModifier access = AccessModifier.Public, ImplementationModifier implementation = ImplementationModifier.SingleFile, IType parent = null, Constructor[] constructors = null, Field[] fields = null, Event[] events = null, Property[] properties = null, IType[] innerTypes = null, Method[] methods = null, IType[] interfaces = null, Attribute[] attributes = null) : base(name, documentation, access, events, properties, methods, interfaces, attributes)
 {
     this.Parent         = parent;
     this.Fields         = fields ?? new Field[0];
     this.Scope          = scope;
     this.Implementation = implementation;
     this.Constructors   = constructors ?? new Constructor[0];
     this.InnerTypes     = innerTypes ?? new Class[0];
 }
예제 #4
0
 public Property(string name, IType type, ScopeModifier scope = ScopeModifier.Instance, AccessModifier access = AccessModifier.Public, string documentation = null, Body getter = null, Body setter = null)
 {
     this.Type          = type;
     this.Name          = name;
     this.Scope         = scope;
     this.Access        = access;
     this.Documentation = documentation;
     this.Getter        = getter;
     this.Setter        = setter;
 }
예제 #5
0
 public static Method WithScope(this Method @this, ScopeModifier value) => new Method(@this.Name,
                                                                                      documentation: @this.Documentation,
                                                                                      returnType: @this.ReturnType,
                                                                                      @override: @this.Override,
                                                                                      access: @this.Access,
                                                                                      scope: value,
                                                                                      async: @this.Sync,
                                                                                      implementation: @this.Implementation,
                                                                                      parameters: @this.Parameters,
                                                                                      body: @this.Body,
                                                                                      attributes: @this.Attributes);
예제 #6
0
        private string Get(ScopeModifier scope)
        {
            switch (scope)
            {
            case ScopeModifier.Extension:
            case ScopeModifier.Static:
                return("static ");

            default:
                return("");
            }
        }
예제 #7
0
 public static Class WithScope(this Class @this, ScopeModifier value) => new Class(@this.Name,
                                                                                   documentation: @this.Documentation,
                                                                                   innerTypes: @this.InnerTypes,
                                                                                   scope: value,
                                                                                   access: @this.Access,
                                                                                   implementation: @this.Implementation,
                                                                                   parent: @this.Parent,
                                                                                   constructors: @this.Constructors,
                                                                                   fields: @this.Fields,
                                                                                   events: @this.Events,
                                                                                   properties: @this.Properties,
                                                                                   methods: @this.Methods,
                                                                                   interfaces: @this.Interfaces);
예제 #8
0
파일: Method.cs 프로젝트: ycfft/CodeBuilder
 public Method(string name, string documentation = null, ScopeModifier scope = ScopeModifier.Instance, OverrideModifier @override = OverrideModifier.None, AccessModifier access = AccessModifier.Public, ImplementationModifier implementation = ImplementationModifier.SingleFile, SyncModifier async = SyncModifier.Synchronous, IType returnType = null, Parameter[] parameters = null, Body body = null, Attribute[] attributes = null)
 {
     this.Name           = name;
     this.Documentation  = documentation;
     this.Parameters     = parameters ?? new Parameter[0];
     this.Attributes     = attributes ?? new Attribute[0];
     this.Body           = body;
     this.ReturnType     = returnType;
     this.Sync           = async;
     this.Override       = @override;
     this.Scope          = scope;
     this.Access         = access;
     this.Implementation = implementation;
 }
예제 #9
0
 public static string ToSource(this ScopeModifier modifier, bool pad = false)
 => modifier.ToCodeOrEmpty(ScopeModifier.None, pad);
예제 #10
0
파일: Event.cs 프로젝트: ycfft/CodeBuilder
 public Event(string name, string documentation = null, IType handlerType = null, ScopeModifier scope = ScopeModifier.Instance, AccessModifier access = AccessModifier.Public)
 {
     this.HandlerType   = handlerType ?? new Type(Modules.System, "EventHandler");
     this.Name          = name;
     this.Documentation = documentation;
     this.Scope         = scope;
     this.Access        = access;
 }
예제 #11
0
 public static Field WithScope(this Field @this, ScopeModifier value) => new Field(@this.Name,
                                                                                   @this.Type,
                                                                                   isReadonly: @this.IsReadonly,
                                                                                   scope: value,
                                                                                   access: @this.Access);
예제 #12
0
 public TSelf WithScope(ScopeModifier modifier)
 {
     value.Scope = modifier;
     return((TSelf)this);
 }
예제 #13
0
 public static Event WithScope(this Event @this, ScopeModifier value) => new Event(@this.Name,
                                                                                   handlerType: @this.HandlerType,
                                                                                   documentation: @this.Documentation,
                                                                                   scope: value,
                                                                                   access: @this.Access);