+ internal static object CreateClientProxy (ActivatedClientTypeEntry entry, object[] activationAttributes)
+ {
+ if (entry.ContextAttributes != null || activationAttributes != null)
+ {
+ ArrayList props = new ArrayList ();
+ if (entry.ContextAttributes != null) props.AddRange (entry.ContextAttributes);
+ if (activationAttributes != null) props.AddRange (activationAttributes);
+ return CreateClientProxy (entry.ObjectType, entry.ApplicationUrl, props.ToArray ());
+ }
+ else
+ return CreateClientProxy (entry.ObjectType, entry.ApplicationUrl, null);
+ }
+
+ internal static object CreateClientProxy (Type objectType, string url, object[] activationAttributes)
+ {
+ string activationUrl = url + "/RemoteActivationService.rem";
+
+ string objectUri;
+ GetClientChannelSinkChain (activationUrl, null, out objectUri);
+
+ RemotingProxy proxy = new RemotingProxy (objectType, activationUrl, activationAttributes);
+ return proxy.GetTransparentProxy();
+ }
+
+ internal static object CreateClientProxy (WellKnownClientTypeEntry entry)
+ {
+ return Connect (entry.ObjectType, entry.ObjectUrl, null);
+ }
+
+ internal static object CreateClientProxyForContextBound (Type type, object[] activationAttributes)
+ {
+ if (type.IsContextful)
+ {
+ // Look for a ProxyAttribute
+ ProxyAttribute att = (ProxyAttribute) Attribute.GetCustomAttribute (type, typeof(ProxyAttribute), true);
+ if (att != null)
+ return att.CreateInstance (type);
+ }
+ RemotingProxy proxy = new RemotingProxy (type, ChannelServices.CrossContextUrl, activationAttributes);
+ return proxy.GetTransparentProxy();
+ }
+
+ internal static object CreateClientProxyForComInterop (Type type)
+ {
+ Mono.Interop.ComInteropProxy proxy = new Mono.Interop.ComInteropProxy (type);
+ return proxy.GetTransparentProxy ();
+ }
+