public static Method WithOverride(this Method @this, OverrideModifier value) => new Method(@this.Name, documentation: @this.Documentation, returnType: @this.ReturnType, @override: value, access: @this.Access, scope: @this.Scope, async: @this.Sync, implementation: @this.Implementation, parameters: @this.Parameters, body: @this.Body, attributes: @this.Attributes);
private string Get(OverrideModifier o) { switch (o) { case OverrideModifier.Virtual: return(" virtual"); case OverrideModifier.Override: return(" override"); default: return(""); } }
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; }