コード例 #1
0
 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> ();
 }
コード例 #2
0
        public DelegateCommandDef(string name, Delegate handlerDelegate, AppConfig appConfig)
        {
            _delegate = handlerDelegate;

            Name            = name;
            InvokeMethodDef = new MethodDef(handlerDelegate.Method, appConfig, false);
        }
コード例 #3
0
ファイル: MethodDef.cs プロジェクト: vijaydairyf/PrtgAPI
        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;
        }
コード例 #4
0
        public MethodCommandDef(MethodInfo method, Type commandHostClassType, AppConfig appConfig)
        {
            _method = method;

            Name = method.BuildName(CommandNodeType.Command, appConfig);
            CommandHostClassType = commandHostClassType;
            InvokeMethodDef      = new MethodDef(method, appConfig, false);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        public DelegateCommandDef(string name, Delegate handlerDelegate, AppConfig appConfig)
        {
            _delegate = handlerDelegate;

            Name = name;
            InterceptorMethodDef = NullMethodDef.Instance;
            InvokeMethodDef      = new MethodDef(handlerDelegate.Method, appConfig);
        }
コード例 #7
0
ファイル: symbolwriter.cs プロジェクト: z3nth10n/ILSpy-CMD
 public static SourceMethodBuilder OpenMethod(ICompileUnit file, IMethodDef method)
 {
     if (symwriter != null)
     {
         return(symwriter.OpenMethod(file, -1 /* Not used */, method));
     }
     else
     {
         return(null);
     }
 }
コード例 #8
0
 public static SourceMethodBuilder OpenMethod(ICompileUnit file, int ns_id,
                                              IMethodDef method)
 {
     if (symwriter != null)
     {
         return(symwriter.OpenMethod(file, ns_id, method));
     }
     else
     {
         return(null);
     }
 }
コード例 #9
0
        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));
        }
コード例 #10
0
 public SourceMethodBuilder(ICompileUnit comp_unit, int ns_id, IMethodDef method)
     : this(comp_unit)
 {
     this.ns_id  = ns_id;
     this.method = method;
 }
コード例 #11
0
ファイル: SourceMethodBuilder.cs プロジェクト: dyxu/vimrc
		public SourceMethodBuilder (ICompileUnit comp_unit, int ns_id, IMethodDef method)
			: this (comp_unit)
		{
			this.ns_id = ns_id;
			this.method = method;
		}
コード例 #12
0
		public static SourceMethodBuilder OpenMethod (ICompileUnit file, int ns_id,
							      IMethodDef method)
		{
			if (symwriter != null)
				return symwriter.OpenMethod (file, ns_id, method);
			else
				return null;
		}
コード例 #13
0
ファイル: symbolwriter.cs プロジェクト: 0xd4d/NRefactory
		public static SourceMethodBuilder OpenMethod (ICompileUnit file, IMethodDef method)
		{
			if (symwriter != null)
				return symwriter.OpenMethod (file, -1 /* Not used */, method);
			else
				return null;
		}
コード例 #14
0
		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];
		}
コード例 #15
0
		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;
		}