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);
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; }
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]; }
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; }
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);
private string Get(ScopeModifier scope) { switch (scope) { case ScopeModifier.Extension: case ScopeModifier.Static: return("static "); default: return(""); } }
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);
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; }
public static string ToSource(this ScopeModifier modifier, bool pad = false) => modifier.ToCodeOrEmpty(ScopeModifier.None, pad);
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; }
public static Field WithScope(this Field @this, ScopeModifier value) => new Field(@this.Name, @this.Type, isReadonly: @this.IsReadonly, scope: value, access: @this.Access);
public TSelf WithScope(ScopeModifier modifier) { value.Scope = modifier; return((TSelf)this); }
public static Event WithScope(this Event @this, ScopeModifier value) => new Event(@this.Name, handlerType: @this.HandlerType, documentation: @this.Documentation, scope: value, access: @this.Access);