public SourceMethodBuilder(ICompileUnit comp_unit, int ns_id, IMethodDef method) { this._comp_unit = comp_unit; this._method = method; this._ns_id = ns_id; method_lines = new List <LineNumberEntry> (); }
public DelegateCommandDef(string name, Delegate handlerDelegate, AppConfig appConfig) { _delegate = handlerDelegate; Name = name; InvokeMethodDef = new MethodDef(handlerDelegate.Method, appConfig, false); }
private MethodDef(IMethodDef original, string name = null, string returnType = null, XmlElement summary = null, XmlElement returnDescription = null, IException exception = null, ReadOnlyCollection <GenericArg> genericArgs = null, ReadOnlyCollection <Parameter> parameters = null, XmlElement bodyElement = null, XmlElement syncBodyElement = null, XmlElement asyncBodyElement = null, XmlElement syncAsyncBodyElement = null, XmlElement streamBodyElement = null, XmlElement tokenBodyElement = null, string overload = null, bool?needsStream = null, bool?streamSerial = null, bool?needsAsync = null, TokenMode tokenMode = TokenMode.None) { methodDefXml = original.GetMethodDefXml(); Name = name ?? original.Name; ReturnType = returnType ?? original.ReturnType; Summary = summary ?? original.Summary; ReturnDescription = returnDescription ?? original.ReturnDescription; Exception = exception ?? (original.Exception != null ? new Exception(original.Exception) : null); GenericArgs = genericArgs != null && genericArgs.Count > 0 ? genericArgs : original.GenericArgs?.Select(a => new GenericArg(a)).ToReadOnlyList(); Parameters = parameters != null && parameters.Count > 0 ? parameters : original.Parameters?.Select(p => new Parameter(p)).ToReadOnlyList(); BodyElement = bodyElement ?? (XmlElement)original.BodyElement?.CloneNode(true); SyncBodyElement = syncBodyElement ?? (XmlElement)original.SyncBodyElement?.CloneNode(true); AsyncBodyElement = asyncBodyElement ?? (XmlElement)original.AsyncBodyElement?.CloneNode(true); SyncAsyncBodyElement = syncAsyncBodyElement ?? (XmlElement)original.SyncAsyncBodyElement?.CloneNode(true); StreamBodyElement = streamBodyElement ?? (XmlElement)original.StreamBodyElement?.CloneNode(true); TokenBodyElement = tokenBodyElement ?? (XmlElement)original.TokenBodyElement?.CloneNode(true); Overload = overload ?? original.Overload; NeedsStream = needsStream.HasValue ? needsStream.Value : original.NeedsStream; NeedsAsync = needsAsync.HasValue ? needsAsync.Value : original.NeedsAsync; TokenMode = tokenMode != TokenMode.None ? tokenMode : original.TokenMode; }
public MethodCommandDef(MethodInfo method, Type commandHostClassType, AppConfig appConfig) { _method = method; Name = method.BuildName(CommandNodeType.Command, appConfig); CommandHostClassType = commandHostClassType; InvokeMethodDef = new MethodDef(method, appConfig, false); }
public SourceMethodBuilder OpenMethod(ICompileUnit file, int ns_id, IMethodDef method) { SourceMethodBuilder builder = new SourceMethodBuilder(file, ns_id, method); current_method_stack.Push(current_method); current_method = builder; return(builder); }
public DelegateCommandDef(string name, Delegate handlerDelegate, AppConfig appConfig) { _delegate = handlerDelegate; Name = name; InterceptorMethodDef = NullMethodDef.Instance; InvokeMethodDef = new MethodDef(handlerDelegate.Method, appConfig); }
public static SourceMethodBuilder OpenMethod(ICompileUnit file, IMethodDef method) { if (symwriter != null) { return(symwriter.OpenMethod(file, -1 /* Not used */, method)); } else { return(null); } }
public static SourceMethodBuilder OpenMethod(ICompileUnit file, int ns_id, IMethodDef method) { if (symwriter != null) { return(symwriter.OpenMethod(file, ns_id, method)); } else { return(null); } }
private ClassCommandDef(Type classType, CommandContext commandContext) { CommandHostClassType = classType ?? throw new ArgumentNullException(nameof(classType)); _commandContext = commandContext ?? throw new ArgumentNullException(nameof(commandContext)); Name = classType.BuildName(CommandNodeType.Command, commandContext.AppConfig); var(interceptorMethod, defaultCommand, localCommands) = ParseMethods(commandContext.AppConfig); InterceptorMethodDef = interceptorMethod; _defaultCommandDef = defaultCommand; // lazy loading prevents walking the entire hierarchy of sub-commands _subCommands = new Lazy <List <ICommandDef> >(() => GetSubCommands(localCommands)); }
public SourceMethodBuilder(ICompileUnit comp_unit, int ns_id, IMethodDef method) : this(comp_unit) { this.ns_id = ns_id; this.method = method; }
public SourceMethodBuilder (ICompileUnit comp_unit, int ns_id, IMethodDef method) : this (comp_unit) { this.ns_id = ns_id; this.method = method; }
public static SourceMethodBuilder OpenMethod (ICompileUnit file, int ns_id, IMethodDef method) { if (symwriter != null) return symwriter.OpenMethod (file, ns_id, method); else return null; }
public static SourceMethodBuilder OpenMethod (ICompileUnit file, IMethodDef method) { if (symwriter != null) return symwriter.OpenMethod (file, -1 /* Not used */, method); else return null; }
public SourceMethodBuilder (ICompileUnit comp_unit, int ns_id, IMethodDef method) { this._comp_unit = comp_unit; this._method = method; this._ns_id = ns_id; method_lines = new LineNumberEntry [50]; }
public SourceMethodBuilder OpenMethod (ICompileUnit file, int ns_id, IMethodDef method) { SourceMethodBuilder builder = new SourceMethodBuilder (file, ns_id, method); current_method_stack.Push (current_method); current_method = builder; methods.Add (current_method); return builder; }