Explorar el Código

Revert part of r110042.

svn path=/trunk/mcs/; revision=110045
Gert Driesen hace 17 años
padre
commit
0d2dae8b4d

+ 0 - 9
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc/ChangeLog

@@ -1,12 +1,3 @@
-2008-08-09  Gert Driesen  <[email protected]>
-
-	* IpcChannel.cs: Fixed argument names to match MS. Changed spaces to
-	tabs.
-	* IpcClientChannel.cs: Fixed argument names to match MS. Changed spaces
-	to tabs.
-	* IpcServerChannel.cs: Fixed argument names to match MS. Changed spaces
-	to tabs.
-
 2005-11-05  Robert Jordan  <[email protected]>
 
 	* IpcServerChannel.cs: Implemented missing GetChannelUri ().

+ 82 - 83
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc/IpcChannel.cs

@@ -33,93 +33,92 @@ using System.Collections;
 using System.Runtime.Remoting;
 using System.Runtime.Remoting.Messaging;
 
-using Unix = System.Runtime.Remoting.Channels.Ipc.Unix;
+using Unix  = System.Runtime.Remoting.Channels.Ipc.Unix;
 using Win32 = System.Runtime.Remoting.Channels.Ipc.Win32;
 
 namespace System.Runtime.Remoting.Channels.Ipc
 {
-	public class IpcChannel : IChannelReceiver, IChannelSender, IChannel
-	{
-		readonly IChannel _innerChannel;
-
-		internal static bool IsUnix
-		{
-			get
-			{
-#if NET_2_0
-				return Environment.OSVersion.Platform == PlatformID.Unix;
-#else
-				return (int) Environment.OSVersion.Platform == 128;
-#endif
-			}
-		}
-
-		public IpcChannel ()
-		{
-			if (IsUnix)
-				_innerChannel = new Unix.IpcChannel ();
-			else
-				_innerChannel = new Win32.IpcChannel ();
-		}
-
-		public IpcChannel (string portName)
-		{
-			if (IsUnix)
-				_innerChannel = new Unix.IpcChannel (portName);
-			else
-				_innerChannel = new Win32.IpcChannel (portName);
-		}
-
-		public IpcChannel (IDictionary properties,
-				   IClientChannelSinkProvider clientSinkProvider,
-				   IServerChannelSinkProvider serverSinkProvider)
-		{
-			if (IsUnix)
-				_innerChannel = new Unix.IpcChannel (properties, clientSinkProvider, serverSinkProvider);
-			else
-				_innerChannel = new Win32.IpcChannel (properties, clientSinkProvider, serverSinkProvider);
-		}
-
-		public string ChannelName {
-			get { return _innerChannel.ChannelName; }
-		}
-
-		public int ChannelPriority {
-			get { return _innerChannel.ChannelPriority; }
-		}
-
-		public string Parse (string url, out string objectURI)
-		{
-			return _innerChannel.Parse (url, out objectURI);
-		}
-
-		public IMessageSink CreateMessageSink (string url,
-						       object remoteChannelData,
-						       out string objectURI)
-		{
-			return ((IChannelSender) _innerChannel).CreateMessageSink (
-				url, remoteChannelData, out objectURI);
-		}
-
-		public object ChannelData {
-			get { return ((IChannelReceiver) _innerChannel).ChannelData; }
-		}
-
-		public string [] GetUrlsForUri (string objectURI)
-		{
-			return ((IChannelReceiver) _innerChannel).GetUrlsForUri (objectURI);
-		}
-
-		public void StartListening (object data)
-		{
-			((IChannelReceiver) _innerChannel).StartListening (data);
-		}
-
-		public void StopListening (object data)
-		{
-			((IChannelReceiver) _innerChannel).StopListening (data);
-		}
-	}
+        public class IpcChannel : IChannelReceiver, IChannelSender, IChannel
+        {
+                IChannel _innerChannel;
+
+                internal static bool IsUnix
+                {
+                        get { 
+                                int p = (int) Environment.OSVersion.Platform;
+                                return ((p == 4) || (p == 128));
+                        }
+                }
+
+                public IpcChannel ()
+                {
+                        if (IsUnix)
+                                _innerChannel = new Unix.IpcChannel ();
+                        else
+                                _innerChannel = new Win32.IpcChannel ();
+                }
+
+                public IpcChannel (string portName)
+                {
+                        if (IsUnix)
+                                _innerChannel = new Unix.IpcChannel (portName);
+                        else
+                                _innerChannel = new Win32.IpcChannel (portName);
+                }
+
+                public IpcChannel (IDictionary properties,
+                                   IClientChannelSinkProvider clientSinkProvider,
+                                   IServerChannelSinkProvider serverSinkProvider)
+                {
+                        if (IsUnix)
+                                _innerChannel = new Unix.IpcChannel (properties, clientSinkProvider, serverSinkProvider);
+                        else
+                                _innerChannel = new Win32.IpcChannel (properties, clientSinkProvider, serverSinkProvider);
+                }
+
+                public string ChannelName
+                {
+                        get { return _innerChannel.ChannelName; }
+                }
+
+                public int ChannelPriority
+                {
+                        get { return _innerChannel.ChannelPriority; }
+                }
+
+                public string Parse (string url, out string objectUri)
+                {
+                        return _innerChannel.Parse (url, out objectUri);
+                }
+
+                public IMessageSink CreateMessageSink (string url,
+                                                       object remoteChannelData,
+                                                       out string objectUri)
+                {
+                        return ((IChannelSender)_innerChannel).CreateMessageSink (url, remoteChannelData, out objectUri);
+                }
+
+                public object ChannelData
+                {
+                        get { return ((IChannelReceiver)_innerChannel).ChannelData; }
+                }
+
+                public string[] GetUrlsForUri (string objectUri)
+                {
+                        return ((IChannelReceiver)_innerChannel).GetUrlsForUri (objectUri);
+                }
+
+                public void StartListening (object data)
+                {
+                        ((IChannelReceiver)_innerChannel).StartListening (data);
+                }
+
+                public void StopListening (object data)
+                {
+                        ((IChannelReceiver)_innerChannel).StopListening (data);
+                }
+
+        }
 }
 
 #endif

+ 46 - 45
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc/IpcClientChannel.cs

@@ -33,62 +33,63 @@ using System.Collections;
 using System.Runtime.Remoting;
 using System.Runtime.Remoting.Messaging;
 
-using Unix = System.Runtime.Remoting.Channels.Ipc.Unix;
+using Unix  = System.Runtime.Remoting.Channels.Ipc.Unix;
 using Win32 = System.Runtime.Remoting.Channels.Ipc.Win32;
 
 namespace System.Runtime.Remoting.Channels.Ipc
 {
-	public class IpcClientChannel : IChannelSender, IChannel
-	{
-		readonly IChannelSender _innerChannel;
+        public class IpcClientChannel : IChannelSender, IChannel
+        {
+                IChannelSender _innerChannel;
 
-		public IpcClientChannel ()
-		{
-			if (IpcChannel.IsUnix)
-				_innerChannel = new Unix.IpcClientChannel ();
-			else
-				_innerChannel = new Win32.IpcClientChannel ();
-		}
+                public IpcClientChannel ()
+                {
+                        if (IpcChannel.IsUnix)
+                                _innerChannel = new Unix.IpcClientChannel ();
+                        else
+                                _innerChannel = new Win32.IpcClientChannel ();
+                }
 
-		public IpcClientChannel (IDictionary properties,
-					 IClientChannelSinkProvider sinkProvider)
-		{
-			if (IpcChannel.IsUnix)
-				_innerChannel = new Unix.IpcClientChannel (properties, sinkProvider);
-			else
-				_innerChannel = new Win32.IpcClientChannel (properties, sinkProvider);
-		}
+                public IpcClientChannel (IDictionary properties,
+                                         IClientChannelSinkProvider sinkProvider)
+                {
+                        if (IpcChannel.IsUnix)
+                                _innerChannel = new Unix.IpcClientChannel (properties, sinkProvider);
+                        else
+                                _innerChannel = new Win32.IpcClientChannel (properties, sinkProvider);
+                }
 
-		public IpcClientChannel (string name,
-					 IClientChannelSinkProvider sinkProvider)
-		{
-			if (IpcChannel.IsUnix)
-				_innerChannel = new Unix.IpcClientChannel (name, sinkProvider);
-			else
-				_innerChannel = new Win32.IpcClientChannel (name, sinkProvider);
-		}
+                public IpcClientChannel (string name,
+                                         IClientChannelSinkProvider sinkProvider)
+                {
+                        if (IpcChannel.IsUnix)
+                                _innerChannel = new Unix.IpcClientChannel (name, sinkProvider);
+                        else
+                                _innerChannel = new Win32.IpcClientChannel (name, sinkProvider);
+                }
 
-		public string ChannelName {
-			get { return ((IChannel) _innerChannel).ChannelName; }
-		}
+                public string ChannelName
+                {
+                        get { return ((IChannel)_innerChannel).ChannelName; }
+                }
 
-		public int ChannelPriority {
-			get { return ((IChannel) _innerChannel).ChannelPriority; }
-		}
+                public int ChannelPriority
+                {
+                        get { return ((IChannel)_innerChannel).ChannelPriority; }
+                }
 
-		public string Parse (string url, out string objectURI)
-		{
-			return ((IChannel) _innerChannel).Parse (url, out objectURI);
-		}
+                public string Parse (string url, out string objectUri)
+                {
+                        return ((IChannel)_innerChannel).Parse (url, out objectUri);
+                }
 
-		public virtual IMessageSink CreateMessageSink (string url,
-							       object remoteChannelData,
-							       out string objectURI)
-		{
-			return _innerChannel.CreateMessageSink (url,
-				remoteChannelData, out objectURI);
-		}
-	}
+                public IMessageSink CreateMessageSink (string url,
+                                                       object remoteChannelData,
+                                                       out string objectUri)
+                {
+                        return _innerChannel.CreateMessageSink (url, remoteChannelData, out objectUri);
+                }
+    }
 }
 
 #endif

+ 91 - 88
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc/IpcServerChannel.cs

@@ -32,98 +32,101 @@ using System;
 using System.Collections;
 using System.Runtime.Remoting;
 
-using Unix = System.Runtime.Remoting.Channels.Ipc.Unix;
+using Unix  = System.Runtime.Remoting.Channels.Ipc.Unix;
 using Win32 = System.Runtime.Remoting.Channels.Ipc.Win32;
 
 namespace System.Runtime.Remoting.Channels.Ipc
 {
-	public class IpcServerChannel : IChannelReceiver, IChannel
-	{
-		readonly IChannelReceiver _innerChannel;
-		readonly string _portName;
-
-		public IpcServerChannel (string portName)
-		{
-			_portName = portName;
-
-			if (IpcChannel.IsUnix)
-				_innerChannel = new Unix.IpcServerChannel (portName);
-			else
-				_innerChannel = new Win32.IpcServerChannel (portName);
-		}
-
-		public IpcServerChannel (IDictionary properties,
-					 IServerChannelSinkProvider sinkProvider)
-		{
-			if (properties != null)
-				_portName = properties ["portName"] as string;
-
-			if (IpcChannel.IsUnix)
-				_innerChannel = new Unix.IpcServerChannel (properties, sinkProvider);
-			else
-				_innerChannel = new Win32.IpcServerChannel (properties, sinkProvider);
-		}
-
-		public IpcServerChannel (string name, string portName,
-					 IServerChannelSinkProvider sinkProvider)
-		{
-			_portName = portName;
-
-			if (IpcChannel.IsUnix)
-				_innerChannel = new Unix.IpcServerChannel (name, portName, sinkProvider);
-			else
-				_innerChannel = new Win32.IpcServerChannel (name, portName, sinkProvider);
-		}
-
-		public IpcServerChannel (string name, string portName)
-		{
-			_portName = portName;
-
-			if (IpcChannel.IsUnix)
-				_innerChannel = new Unix.IpcServerChannel (name, portName);
-			else
-				_innerChannel = new Win32.IpcServerChannel (name, portName);
-		}
-
-		public string ChannelName {
-			get { return ((IChannel) _innerChannel).ChannelName; }
-		}
-
-		public int ChannelPriority {
-			get { return ((IChannel) _innerChannel).ChannelPriority; }
-		}
-
-		public string Parse (string url, out string objectURI)
-		{
-			return ((IChannel) _innerChannel).Parse (url, out objectURI);
-		}
-
-		public object ChannelData {
-			get { return _innerChannel.ChannelData; }
-		}
-
-		public virtual string [] GetUrlsForUri (string objectUri)
-		{
-			return _innerChannel.GetUrlsForUri (objectUri);
-		}
-
-		public void StartListening (object data)
-		{
-			_innerChannel.StartListening (data);
-		}
-
-		public void StopListening (object data)
-		{
-			_innerChannel.StopListening (data);
-		}
-
-		public string GetChannelUri ()
-		{
-			// There is no interface for this member,
-			// so we cannot delegate to the inner channel.
-			return Win32.IpcChannelHelper.SchemeStart + _portName;
-		}
-	}
+        public class IpcServerChannel : IChannelReceiver, IChannel
+        {
+                IChannelReceiver _innerChannel;
+                string _portName;
+
+                public IpcServerChannel (string portName)
+                {
+                        _portName = portName;
+
+                        if (IpcChannel.IsUnix)
+                                _innerChannel = new Unix.IpcServerChannel (portName);
+                        else
+                                _innerChannel = new Win32.IpcServerChannel (portName);
+                }
+
+                public IpcServerChannel (IDictionary properties,
+                                         IServerChannelSinkProvider serverSinkProvider)
+                {
+                        if (properties != null)
+                                _portName = properties ["portName"] as string;
+
+                        if (IpcChannel.IsUnix)
+                                _innerChannel = new Unix.IpcServerChannel (properties, serverSinkProvider);
+                        else
+                                _innerChannel = new Win32.IpcServerChannel (properties, serverSinkProvider);
+                }
+
+                public IpcServerChannel (string name, string portName,
+                                         IServerChannelSinkProvider serverSinkProvider)
+                {
+                        _portName = portName;
+
+                        if (IpcChannel.IsUnix)
+                                _innerChannel = new Unix.IpcServerChannel (name, portName, serverSinkProvider);
+                        else
+                                _innerChannel = new Win32.IpcServerChannel (name, portName, serverSinkProvider);
+                }
+        
+                public IpcServerChannel (string name, string portName)
+                {
+                        _portName = portName;
+
+                        if (IpcChannel.IsUnix)
+                                _innerChannel = new Unix.IpcServerChannel (name, portName);
+                        else
+                                _innerChannel = new Win32.IpcServerChannel (name, portName);
+                }
+
+                public string ChannelName
+                {
+                        get { return ((IChannel)_innerChannel).ChannelName; }
+                }
+
+                public int ChannelPriority
+                {
+                        get { return ((IChannel)_innerChannel).ChannelPriority; }
+                }
+
+                public string Parse (string url, out string objectUri)
+                {
+                        return ((IChannel)_innerChannel).Parse (url, out objectUri);
+                }
+
+                public object ChannelData
+                {
+                        get { return _innerChannel.ChannelData; }
+                }
+
+                public string[] GetUrlsForUri (string objectUri)
+                {
+                        return _innerChannel.GetUrlsForUri (objectUri);
+                }
+
+                public void StartListening (object data)
+                {
+                        _innerChannel.StartListening (data);
+                }
+
+                public void StopListening (object data)
+                {
+                        _innerChannel.StopListening (data);
+                }
+        
+                public string GetChannelUri ()
+                {
+                        // There is no interface for this member,
+                        // so we cannot delegate to the inner channel.
+                        return Win32.IpcChannelHelper.SchemeStart + _portName;
+                }
+        }
 }
 
 #endif