2 // System.Runtime.Remoting.Activation.RemoteActivationAttribute.cs
4 // Author: Lluis Sanchez Gual (lluis@ideary.com)
6 // (C) 2003, Lluis Sanchez Gual
10 using System.Runtime.Remoting.Activation;
11 using System.Runtime.Remoting.Contexts;
12 using System.Collections;
14 namespace System.Runtime.Remoting.Activation
16 internal class RemoteActivationAttribute: Attribute, IContextAttribute
18 // This activation attribute is used when creating a client activated
19 // CBO in the server. This attribute will enforce the creation of
20 // a new context, and will provide the context properties collected in
23 IList _contextProperties;
25 public RemoteActivationAttribute ()
29 public RemoteActivationAttribute(IList contextProperties)
31 _contextProperties = contextProperties;
34 public bool IsContextOK(Context ctx, IConstructionCallMessage ctor)
36 // CBOs remotely activated allways need a new context
40 public void GetPropertiesForNewContext(IConstructionCallMessage ctor)
42 if (_contextProperties != null)
44 foreach (object prop in _contextProperties)
45 ctor.ContextProperties.Add (prop);