コード例 #1
0
 protected InvocationTypeGenerator(Type targetType, MetaMethod method, MethodInfo callback, bool canChangeTarget,
                                   IInvocationCreationContributor contributor)
 {
     this.targetType      = targetType;
     this.method          = method;
     this.callback        = callback;
     this.canChangeTarget = canChangeTarget;
     this.contributor     = contributor;
 }
コード例 #2
0
 public MetaProperty(PropertyInfo property, MetaMethod getter, MetaMethod setter,
                     IEnumerable <CustomAttributeBuilder> customAttributes, Type[] arguments)
     : base(property)
 {
     this.getter           = getter;
     this.setter           = setter;
     attributes            = PropertyAttributes.None;
     this.customAttributes = customAttributes;
     this.arguments        = arguments ?? Type.EmptyTypes;
 }
コード例 #3
0
 public MethodWithInvocationGenerator(MetaMethod method, Reference interceptors, Type invocation,
                                      GetTargetExpressionDelegate getTargetExpression,
                                      OverrideMethodDelegate createMethod, IInvocationCreationContributor contributor)
     : base(method, createMethod)
 {
     this.invocation          = invocation;
     this.getTargetExpression = getTargetExpression;
     this.interceptors        = interceptors;
     this.contributor         = contributor;
 }
コード例 #4
0
 public MetaProperty(string name, Type propertyType, Type declaringType, MetaMethod getter, MetaMethod setter, PropertyAttributes attributes, IEnumerable <CustomAttributeBuilder> customAttributes)
     : base(declaringType)
 {
     this.name             = name;
     this.type             = propertyType;
     this.getter           = getter;
     this.setter           = setter;
     this.attributes       = attributes;
     this.customAttributes = customAttributes;
 }
コード例 #5
0
 public MetaProperty(string name, Type propertyType, Type declaringType, MetaMethod getter, MetaMethod setter, IEnumerable <CustomAttributeBuilder> customAttributes, Type[] arguments)
     : base(declaringType)
 {
     this.name             = name;
     this.type             = propertyType;
     this.getter           = getter;
     this.setter           = setter;
     this.attributes       = PropertyAttributes.None;
     this.customAttributes = customAttributes;
     this.arguments        = arguments ?? Type.EmptyTypes;
 }
コード例 #6
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "MetaEvent" /> class.
 /// </summary>
 /// <param name = "event">The event.</param>
 /// <param name = "adder">The add method.</param>
 /// <param name = "remover">The remove method.</param>
 /// <param name = "attributes">The attributes.</param>
 public MetaEvent(EventInfo @event, MetaMethod adder, MetaMethod remover, EventAttributes attributes)
     : base(@event)
 {
     if (adder == null)
     {
         throw new ArgumentNullException(nameof(adder));
     }
     if (remover == null)
     {
         throw new ArgumentNullException(nameof(remover));
     }
     this.adder   = adder;
     this.remover = remover;
     Attributes   = attributes;
 }
コード例 #7
0
ファイル: MetaEvent.cs プロジェクト: Orvid/NAntUniversalTasks
 /// <summary>
 /// Initializes a new instance of the <see cref="MetaEvent"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="declaringType">Type declaring the original event being overriten, or null.</param>
 /// <param name="eventDelegateType"></param>
 /// <param name="adder">The add method.</param>
 /// <param name="remover">The remove method.</param>
 /// <param name="attributes">The attributes.</param>
 public MetaEvent(string name, Type declaringType, Type eventDelegateType, MetaMethod adder, MetaMethod remover, EventAttributes attributes)
     : base(declaringType)
 {
     if (adder == null)
     {
         throw new ArgumentNullException("adder");
     }
     if (remover == null)
     {
         throw new ArgumentNullException("remover");
     }
     this.name       = name;
     this.type       = eventDelegateType;
     this.adder      = adder;
     this.remover    = remover;
     this.Attributes = attributes;
 }
コード例 #8
0
 public MethodWithInvocationGenerator(
     MetaMethod method,
     IExpression interceptors,
     Type invocation,
     GetTargetExpressionDelegate getTargetExpression,
     OverrideMethodDelegate createMethod,
     IInvocationCreationContributor contributor
     )
     : this(
         method,
         interceptors,
         invocation,
         getTargetExpression,
         null,
         createMethod,
         contributor
         )
 {
 }
コード例 #9
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "MetaEvent" /> class.
 /// </summary>
 /// <param name = "name">The name.</param>
 /// <param name = "declaringType">Type declaring the original event being overriten, or null.</param>
 /// <param name = "eventDelegateType"></param>
 /// <param name = "adder">The add method.</param>
 /// <param name = "remover">The remove method.</param>
 /// <param name = "attributes">The attributes.</param>
 public MetaEvent(EventInfo @event, MetaMethod adder, MetaMethod remover,
                  EventAttributes attributes)
     : base(@event.DeclaringType)
 {
     if (adder == null)
     {
         throw new ArgumentNullException("adder");
     }
     if (remover == null)
     {
         throw new ArgumentNullException("remover");
     }
     this.Event   = @event;
     this.name    = @event.Name;
     type         = @event.EventHandlerType;
     this.adder   = adder;
     this.remover = remover;
     Attributes   = attributes;
 }
コード例 #10
0
 public ForwardingMethodGenerator(MetaMethod method, OverrideMethodDelegate overrideMethod,
                                  GetTargetReferenceDelegate getTargetReference)
     : base(method, overrideMethod)
 {
     this.getTargetReference = getTargetReference;
 }
コード例 #11
0
ファイル: MetaType.cs プロジェクト: wellengineered-us/solder
 public void AddMethod(MetaMethod method)
 {
     methods.Add(method);
 }
コード例 #12
0
 public InterfaceInvocationTypeGenerator(Type target, MetaMethod method, MethodInfo callback, bool canChangeTarget)
     : base(target, method, callback, canChangeTarget)
 {
 }
コード例 #13
0
 protected MethodGenerator(MetaMethod method, OverrideMethodDelegate overrideMethod)
 {
     this.method         = method;
     this.overrideMethod = overrideMethod;
 }
コード例 #14
0
 public CompositionInvocationTypeGenerator(Type target, MetaMethod method, MethodInfo callback, bool canChangeTarget,
                                           IInvocationCreationContributor contributor)
     : base(target, method, callback, canChangeTarget, contributor)
 {
 }
コード例 #15
0
 public InheritanceInvocationTypeGenerator(Type targetType, MetaMethod method, IMethodInfo callback,
                                           IInvocationCreationContributor contributor)
     : base(targetType, method, callback, false, contributor)
 {
 }
コード例 #16
0
 public MinimalisticMethodGenerator(MetaMethod method, OverrideMethodDelegate overrideMethod)
     : base(method, overrideMethod)
 {
 }
コード例 #17
0
 protected MethodGenerator(MetaMethod method, CreateMethodDelegate createMethod)
 {
     this.method       = method;
     this.createMethod = createMethod;
 }
コード例 #18
0
 public DelegateTypeGenerator(MetaMethod method, Type targetType)
 {
     this.method     = method;
     this.targetType = targetType;
 }
コード例 #19
0
 public ClassInvocationTypeGenerator(Type targetType, MetaMethod method, MethodInfo callback)
     : base(targetType, method, callback, false)
 {
 }
コード例 #20
0
 public void AddMethod(MetaMethod method)
 {
     methods.Add(method);
     methodsIndex.Add(method.Method, method); // shouldn't get added twice
 }