private PrimitiveBinderWrapper(T value, PrimitiveBinder <T> binder) { Guard.ArgumentNotNull(value, "target"); Guard.ArgumentNotNull(binder, "binder"); this.value = value; this.binder = binder; }
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); }
public static IEcmaValueBinder GetBinder(T target, PrimitiveBinder <T> binder) { return(dictionary.GetOrAdd(new RuntimeProxyWeakReference(target)).GetBinder(binder)); }