2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Messaging / ConstructionCall.cs
index 7d0709adf92d65cb39604291eff768ee62aa9a3e..412f1d0043ffa1f123cfd809f9f2e183de533b4f 100644 (file)
@@ -4,54 +4,87 @@
 // Author: Lluis Sanchez Gual (lluis@ideary.com)
 //
 // (C) 2003, Lluis Sanchez Gual
-//\r
-\r
-using System;\r
-using System.Threading;\r
-using System.Collections;\r
-using System.Runtime.Remoting.Activation;\r
-using System.Runtime.Serialization;\r
-using System.Runtime.Remoting.Contexts;\r
-\r
-namespace System.Runtime.Remoting.Messaging\r
-{\r
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Threading;
+using System.Collections;
+using System.Runtime.Remoting.Activation;
+using System.Runtime.Serialization;
+using System.Runtime.Remoting.Contexts;
+using System.Runtime.Remoting.Proxies;
+
+namespace System.Runtime.Remoting.Messaging
+{
        [Serializable] [CLSCompliant (false)]
-       public class ConstructionCall: MethodCall, IConstructionCallMessage\r
-       {\r
-               IActivator _activator;\r
-               object[] _activationAttributes;\r
-               IList _contextProperties;\r
-               Type _activationType;\r
-               string _activationTypeName;\r
-\r
-               public ConstructionCall(IMessage msg): base (msg)\r
-               {\r
-                       _activationTypeName = TypeName;\r
-                       _activationAttributes = null;   // FIXME: put something here\r
-               }\r
-\r
-               public ConstructionCall (Type type)\r
-               {\r
-                       _activationType = type;\r
-                       _activationTypeName = type.AssemblyQualifiedName;\r
-               }\r
-\r
-               public ConstructionCall (Header[] headers): base (headers)\r
-               {\r
-               }\r
-\r
+       public class ConstructionCall: MethodCall, IConstructionCallMessage
+       {
+               IActivator _activator;
+               object[] _activationAttributes;
+               IList _contextProperties;
+               Type _activationType;
+               string _activationTypeName;
+               bool _isContextOk;
+               [NonSerialized] RemotingProxy _sourceProxy;
+
+               public ConstructionCall(IMessage msg): base (msg)
+               {
+                       _activationTypeName = TypeName;
+                       _isContextOk = true;
+               }
+
+               internal ConstructionCall (Type type)
+               {
+                       _activationType = type;
+                       _activationTypeName = type.AssemblyQualifiedName;
+                       _isContextOk = true;
+               }
+
+               public ConstructionCall (Header[] headers): base (headers)
+               {
+               }
+
                internal ConstructionCall (SerializationInfo info, StreamingContext context): base (info, context)
                {
-               }\r
-\r
-               internal override void InitDictionary()\r
-               {\r
-                       ConstructionCallDictionary props = new ConstructionCallDictionary (this);\r
+               }
+
+               internal override void InitDictionary()
+               {
+                       ConstructionCallDictionary props = new ConstructionCallDictionary (this);
                        ExternalProperties = props;
-                       InternalProperties = props.GetInternalProperties();\r
-               }\r
-\r
-               public Type ActivationType \r
+                       InternalProperties = props.GetInternalProperties();
+               }
+
+               internal bool IsContextOk
+               {
+                       get { return _isContextOk; }
+                       set { _isContextOk = value; }
+               }
+
+               public Type ActivationType 
                {
                        get 
                        { 
@@ -60,18 +93,18 @@ namespace System.Runtime.Remoting.Messaging
                        }
                }
 
-               public string ActivationTypeName \r
+               public string ActivationTypeName 
                {
                        get { return _activationTypeName; }
                }
 
-               public IActivator Activator \r
+               public IActivator Activator 
                {
                        get { return _activator; }
                        set { _activator = value; }
                }
 
-               public object [] CallSiteActivationAttributes \r
+               public object [] CallSiteActivationAttributes 
                {
                        get { return _activationAttributes; }
                }
@@ -81,15 +114,15 @@ namespace System.Runtime.Remoting.Messaging
                        _activationAttributes = attributes;
                }
 
-               public IList ContextProperties \r
+               public IList ContextProperties 
                {
                        get 
                        {
                                if (_contextProperties == null) _contextProperties = new ArrayList ();
                                return _contextProperties; 
                        }
-               }\r
-\r
+               }
+
                internal override void InitMethodProperty(string key, object value)
                {
                        switch (key)
@@ -115,6 +148,17 @@ namespace System.Runtime.Remoting.Messaging
                        info.AddValue ("__ActivationType", null);
                        info.AddValue ("__ContextProperties", props);
                        info.AddValue ("__ActivationTypeName", _activationTypeName);
-               } \r
-       }\r
-}\r
+               } 
+               
+               public override IDictionary Properties 
+               {
+                       get { return base.Properties; }
+               }
+               
+               internal RemotingProxy SourceProxy
+               {
+                       get { return _sourceProxy; }
+                       set {_sourceProxy = value; }
+               }
+       }
+}