public void RemoveProxy(INetComponentProxy proxy) { if (proxy == null) { throw new ArgumentNullException("proxy"); } var ptype = proxy.GetType(); var interfaces = ptype.GetInterfaces(); _proxies.Remove(ptype); foreach (var face in interfaces) { _proxies.Remove(face); } }
/// <summary> /// Add a proxy to the network view to use for Proxy`T() /// </summary> /// <param name="proxy"></param> /// <exception cref="ArgumentNullException"></exception> public void AddProxy(INetComponentProxy proxy) { if (proxy == null) { throw new ArgumentNullException("proxy"); } proxy.NetworkView = this; var ptype = proxy.GetType(); var interfaces = ptype.GetInterfaces(); _proxies[ptype] = proxy; foreach (var face in interfaces) { _proxies[face] = proxy; } }