/// <summary> /// Initializes a new instance of the <see cref="Proxy{TInvoke}"/> class. /// </summary> /// <param name="proxy">The proxy.</param> /// <param name="target">The target.</param> public Proxy(ProxyInvoker proxy, TInvoke target) : base(typeof(TInvoke)) { this.proxy = proxy; this.target = target; type = typeof(TInvoke); if (!invokeLookup.ContainsKey(type)) { lookup = new Dictionary <MethodInfo, bool>(); invokeLookup.Add(type, lookup); } else { lookup = invokeLookup[type]; } }
/// <summary> /// Creates the specified proxy. /// </summary> /// <param name="proxy">The proxy.</param> /// <returns></returns> public static TInvoke Create(ProxyInvoker proxy) { return((TInvoke) new Proxy <TInvoke>(proxy, Activator.CreateInstance <TInvoke>()).GetTransparentProxy()); }