2 // System.Runtime.Remoting.Proxies.ProxyAttribute.cs
4 // Author: Duncan Mak (duncan@ximian.com)
6 // Copyright (C) Ximian, Inc 2002.
10 using System.Runtime.Remoting;
11 using System.Runtime.Remoting.Activation;
12 using System.Runtime.Remoting.Contexts;
13 using System.Runtime.Remoting.Channels;
15 namespace System.Runtime.Remoting.Proxies {
17 [AttributeUsage (AttributeTargets.Class)]
18 public class ProxyAttribute : Attribute, IContextAttribute
20 public ProxyAttribute ()
24 public virtual MarshalByRefObject CreateInstance (Type serverType)
26 RemotingProxy proxy = new RemotingProxy (serverType, ChannelServices.CrossContextUrl, null);
27 return (MarshalByRefObject) proxy.GetTransparentProxy();
30 public virtual RealProxy CreateProxy (ObjRef objref, Type serverType, object serverObject, Context serverContext)
32 return RemotingServices.GetRealProxy (RemotingServices.GetProxyForRemoteObject (objref, serverType));
35 public void GetPropertiesForNewContext (IConstructionCallMessage msg)
40 public bool IsContextOK (Context ctx, IConstructionCallMessage msg)