* IInternalMessage.cs: Added. Provides some useful methods for method messages.
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Messaging / ConstructionCallDictionary.cs
1 //
2 // System.Runtime.Remoting.Messaging.ConstructionCallDictionary.cs
3 //
4 // Author: Lluis Sanchez Gual (lluis@ideary.com)
5 //
6 // (C) 2003, Lluis Sanchez Gual
7 //\r
8 \r
9 using System;\r
10 using System.Runtime.Remoting.Activation;\r
11 \r
12 namespace System.Runtime.Remoting.Messaging\r
13 {\r
14         class ConstructionCallDictionary : MethodDictionary\r
15         {\r
16                 public static string[] InternalKeys = new string[] {"__Uri", "__MethodName", "__TypeName", "__MethodSignature", "__Args", "__CallContext", "__CallSiteActivationAttributes", "__ActivationType", "__ContextProperties", "__Activator", "__ActivationTypeName"};\r
17 \r
18                 public ConstructionCallDictionary(IConstructionCallMessage message) : base (message) \r
19                 { \r
20                         MethodKeys = InternalKeys;\r
21                 }\r
22
23                 protected override object GetMethodProperty (string key)
24                 {
25                         switch (key)
26                         {
27                                 case "__Activator" : return ((IConstructionCallMessage)_message).Activator;
28                                 case "__CallSiteActivationAttributes" : return ((IConstructionCallMessage)_message).CallSiteActivationAttributes;
29                                 case "__ActivationType" : return ((IConstructionCallMessage)_message).ActivationType;
30                                 case "__ContextProperties" : return ((IConstructionCallMessage)_message).ContextProperties;
31                                 case "__ActivationTypeName" : return ((IConstructionCallMessage)_message).ActivationTypeName;
32                                 default : return base.GetMethodProperty (key);
33                         }
34                 }
35                         
36                 protected override void SetMethodProperty (string key, object value)
37                 {
38                         switch (key)
39                         {
40                                 case "__Activator": ((IConstructionCallMessage)_message).Activator = (IActivator) value; break;
41
42                                 case "__CallSiteActivationAttributes":
43                                 case "__ActivationType": 
44                                 case "__ContextProperties": 
45                                 case "__ActivationTypeName": throw new ArgumentException ("key was invalid");
46
47                                 default: base.SetMethodProperty (key, value); break;
48                         }
49                 }
50         }\r
51 }\r