Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 10
0
 public ForwardingMethodGenerator(MetaMethod method, OverrideMethodDelegate overrideMethod,
                                  GetTargetReferenceDelegate getTargetReference)
     : base(method, overrideMethod)
 {
     this.getTargetReference = getTargetReference;
 }
Ejemplo n.º 11
0
 public void AddMethod(MetaMethod method)
 {
     methods.Add(method);
 }
Ejemplo n.º 12
0
 public InterfaceInvocationTypeGenerator(Type target, MetaMethod method, MethodInfo callback, bool canChangeTarget)
     : base(target, method, callback, canChangeTarget)
 {
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 15
0
 public InheritanceInvocationTypeGenerator(Type targetType, MetaMethod method, IMethodInfo callback,
                                           IInvocationCreationContributor contributor)
     : base(targetType, method, callback, false, contributor)
 {
 }
Ejemplo n.º 16
0
 public MinimalisticMethodGenerator(MetaMethod method, OverrideMethodDelegate overrideMethod)
     : base(method, overrideMethod)
 {
 }
Ejemplo n.º 17
0
 protected MethodGenerator(MetaMethod method, CreateMethodDelegate createMethod)
 {
     this.method       = method;
     this.createMethod = createMethod;
 }
Ejemplo n.º 18
0
 public DelegateTypeGenerator(MetaMethod method, Type targetType)
 {
     this.method     = method;
     this.targetType = targetType;
 }
Ejemplo n.º 19
0
 public ClassInvocationTypeGenerator(Type targetType, MetaMethod method, MethodInfo callback)
     : base(targetType, method, callback, false)
 {
 }
Ejemplo n.º 20
0
 public void AddMethod(MetaMethod method)
 {
     methods.Add(method);
     methodsIndex.Add(method.Method, method); // shouldn't get added twice
 }