New tests.
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel / ClientBase.cs
index 121a8922a503d8100cf1f293ab7f6b2893a7071c..d9e98a1856700aeeaee3c63f3cc801deaa1a8686 100644 (file)
@@ -33,18 +33,19 @@ using System.ServiceModel.Channels;
 using System.ServiceModel.Description;
 using System.ServiceModel.Dispatcher;
 using System.Threading;
+using System.ServiceModel.MonoInternal;
 
 namespace System.ServiceModel
 {
        [MonoTODO ("It somehow rejects classes, but dunno how we can do that besides our code wise.")]
        public abstract class ClientBase<TChannel> :
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
                IDisposable,
 #endif
                ICommunicationObject where TChannel : class
        {
                static InstanceContext initialContxt = new InstanceContext (null);
-#if NET_2_1 && !MONOTOUCH
+#if MOONLIGHT
                static readonly PropertyInfo dispatcher_main_property;
                static readonly MethodInfo dispatcher_begin_invoke_method;
 
@@ -221,7 +222,7 @@ namespace System.ServiceModel
 
                void RunCompletedCallback (SendOrPostCallback callback, InvokeAsyncCompletedEventArgs args)
                {
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
                        callback (args);
 #else
                        object dispatcher = dispatcher_main_property.GetValue (null, null);
@@ -232,9 +233,9 @@ namespace System.ServiceModel
                        EventHandler a = delegate {
                                try {
                                        callback (args); 
-                                       Console.WriteLine ("ClientBase<TChannel>: operationCompletedCallback is successfully done (unless the callback has further async operations)");
+                                       //Console.WriteLine ("ClientBase<TChannel>: operationCompletedCallback is successfully done (unless the callback has further async operations)");
                                } catch (Exception ex) {
-                                       Console.WriteLine ("ClientBase<TChannel> caught an error during operationCompletedCallback: " + ex);
+                                       //Console.WriteLine ("ClientBase<TChannel> caught an error during operationCompletedCallback: " + ex);
                                        throw;
                                }
                        };
@@ -266,16 +267,16 @@ namespace System.ServiceModel
                                        if (operationCompletedCallback != null)
                                                RunCompletedCallback (operationCompletedCallback, new InvokeAsyncCompletedEventArgs (results, error, cancelled, userState));
                                } catch (Exception ex) {
-                                       Console.WriteLine ("Exception during operationCompletedCallback" + ex);
+                                       //Console.WriteLine ("Exception during operationCompletedCallback" + ex);
                                        throw;
                                }
-                               Console.WriteLine ("System.ServiceModel.ClientBase<TChannel>: web service invocation is successfully done (operationCompletedCallback may not be).");
+                               //Console.WriteLine ("System.ServiceModel.ClientBase<TChannel>: web service invocation is successfully done (operationCompletedCallback may not be).");
                        };
                        begin_async_result = beginOperationDelegate (inValues, cb, userState);
                }
                IAsyncResult begin_async_result;
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
                void IDisposable.Dispose ()
                {
                        Close ();
@@ -401,7 +402,7 @@ namespace System.ServiceModel
                                }
                        }
 
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
                        protected object Invoke (string methodName, object [] args)
                        {
                                var cd = endpoint.Contract;