예제 #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;
 }
 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;
 }
 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
 /// <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
         )
 {
 }
 /// <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
 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;
 }
 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
 }