Ejemplo n.º 1
0
 private PrimitiveBinderWrapper(T value, PrimitiveBinder <T> binder)
 {
     Guard.ArgumentNotNull(value, "target");
     Guard.ArgumentNotNull(binder, "binder");
     this.value  = value;
     this.binder = binder;
 }
Ejemplo n.º 2
0
            public PrimitiveBinderWrapper <T> GetBinder(PrimitiveBinder <T> b)
            {
                PrimitiveBinderWrapper <T> binder = (PrimitiveBinderWrapper <T>)binderRef.Target;

                if (binder == null)
                {
                    T target = (T)this.Target;
                    if (target == null)
                    {
                        throw new InvalidOperationException();
                    }
                    binder           = new PrimitiveBinderWrapper <T>(target, b);
                    binderRef.Target = binder;
                }
                return(binder);
            }
Ejemplo n.º 3
0
 public static IEcmaValueBinder GetBinder(T target, PrimitiveBinder <T> binder)
 {
     return(dictionary.GetOrAdd(new RuntimeProxyWeakReference(target)).GetBinder(binder));
 }