Add placeholders for missing methods:
authorFrederik Carlier <frederik.carlier@quamotion.mobi>
Fri, 19 Feb 2016 15:18:42 +0000 (16:18 +0100)
committerFrederik Carlier <frederik.carlier@quamotion.mobi>
Fri, 19 Feb 2016 22:04:07 +0000 (23:04 +0100)
* WSDualHttpBinding: Add additional constructor overloads to match .NET 4.5
* Dispatcher: Add support for the various InvokeAsync methods

mcs/class/System.ServiceModel/System.ServiceModel/WSDualHttpBinding.cs
mcs/class/WindowsBase/System.Windows.Threading/Dispatcher.cs
mcs/class/WindowsBase/System.Windows.Threading/DispatcherOperation.cs

index a531b34cf61ecc9e8bae4294d843b151b299830f..789a602e9df5bc0a9f30c1e7764ad1f9f4978ec5 100644 (file)
@@ -58,7 +58,12 @@ namespace System.ServiceModel
                {
                }
 
-               protected WSDualHttpBinding (WSDualHttpSecurityMode securityMode)
+               public WSDualHttpBinding(string configName)
+                       : this (WSDualHttpSecurityMode.Message)
+               {
+               }
+
+               public WSDualHttpBinding (WSDualHttpSecurityMode securityMode)
                {
                        security = new WSDualHttpSecurity (securityMode);
                }
index a28f7a29d0d3801f1b811d81e3dd1533a2c84a17..1eeb9c9a368866973e0da7f87009a0a1036ebf01 100644 (file)
@@ -1,22 +1,22 @@
 // TODO:
-//    DispatcherObject returned by BeginInvoke must allow:
-//       * Waiting until delegate is invoked.
-//       See: BeginInvoke documentation for details
+//     DispatcherObject returned by BeginInvoke must allow:
+//        * Waiting until delegate is invoked.
+//        See: BeginInvoke documentation for details
 //
-//    Implement the "Invoke" methods, they are currently not working.
+//     Implement the "Invoke" methods, they are currently not working.
 //
-//    Add support for disabling the dispatcher and resuming it.
-//    Add support for Waiting for new tasks to be pushed, so that we dont busy loop.
-//    Add support for aborting an operation (emit the hook.operationaborted too) 
+//     Add support for disabling the dispatcher and resuming it.
+//     Add support for Waiting for new tasks to be pushed, so that we dont busy loop.
+//     Add support for aborting an operation (emit the hook.operationaborted too) 
 //
 // Very confusing information about Shutdown: it states that shutdown is
 // not over, until all events are unwinded, and also states that all events
 // are aborted at that point.  See 'Dispatcher.InvokeShutdown' docs,
 //
 // Testing reveals that 
-//     -> InvokeShutdown() stops processing, even if events are available,
-//        there is no "unwinding" of events, even of higher priority events,
-//        they are just ignored.
+//      -> InvokeShutdown() stops processing, even if events are available,
+//             there is no "unwinding" of events, even of higher priority events,
+//             they are just ignored.
 //
 // The documentation for the Dispatcher family is poorly written, complete
 // sections are cut-and-pasted that add no value and the important pieces
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 // Copyright (c) 2006 Novell, Inc. (http://www.novell.com)
+// Copyright (c) 2016 Quamotion (http://quamotion.mobi)
 //
 // Authors:
 //     Miguel de Icaza (miguel@novell.com)
+//     Frederik Carlier (frederik.carlier@quamotion.mobi)
 //
 using System;
 using System.Collections;
@@ -181,6 +183,21 @@ namespace System.Windows.Threading {
                        return op;
                }
 
+               public DispatcherOperation InvokeAsync (Action callback)
+               {
+                       return this.BeginInvoke(callback);
+               }
+
+               public DispatcherOperation InvokeAsync (Action callback, DispatcherPriority priority)
+               {
+                       return this.BeginInvoke(callback, priority);
+               }
+
+               public DispatcherOperation InvokeAsync (Action callback, DispatcherPriority priority, CancellationToken cancellationToken)
+               {
+                       return this.BeginInvoke(callback, priority);
+               }
+
                public object Invoke (Delegate method, params object[] args)
                {
                        throw new NotImplementedException ();
@@ -521,32 +538,33 @@ namespace System.Windows.Threading {
 
                public void Enqueue (object obj)
                {
-                        if (size == array.Length)
-                                Grow ();
-                        array[tail] = obj;
-                        tail = (tail+1) % array.Length;
-                        size++;
+                       if (size == array.Length)
+                                       Grow ();
+                       array[tail] = obj;
+                       tail = (tail+1) % array.Length;
+                       size++;
                }
 
                public object Dequeue ()
-                {
-                        if (size < 1)
-                                throw new InvalidOperationException ();
-                        object result = array[head];
-                        array [head] = null;
-                        head = (head + 1) % array.Length;
-                        size--;
-                        return result;
-                }
-
-               void Grow () {
-                        int newc = array.Length * 2;
-                        object[] new_contents = new object[newc];
-                        array.CopyTo (new_contents, 0);
-                        array = new_contents;
-                        head = 0;
-                        tail = head + size;
-                }
+               {
+                       if (size < 1)
+                                       throw new InvalidOperationException ();
+                       object result = array[head];
+                       array [head] = null;
+                       head = (head + 1) % array.Length;
+                       size--;
+                       return result;
+               }
+
+               void Grow () 
+               {
+                       int newc = array.Length * 2;
+                       object[] new_contents = new object[newc];
+                       array.CopyTo (new_contents, 0);
+                       array = new_contents;
+                       head = 0;
+                       tail = head + size;
+               }
 
                public int Count {
                        get {
index 5c06c41ac2639922498a73828fd9acc353137067..36299db37d296d090cb5477c6a20fb8ee3745f46 100644 (file)
@@ -29,6 +29,7 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Security;
 using System.Threading;
+using System.Threading.Tasks;
 
 namespace System.Windows.Threading {
 
@@ -90,6 +91,12 @@ namespace System.Windows.Threading {
                        throw new NotImplementedException ();
                }
 
+               public Task Task {
+                       get {
+                               throw new NotImplementedException();
+                       }
+               }
+
                public DispatcherOperationStatus Status {
                        get {
                                return status;