diff options
author | Dmitry Potapov <dpotapov@gmail.com> | 2014-02-02 22:40:55 +0400 |
---|---|---|
committer | Dmitry Potapov <dpotapov@gmail.com> | 2014-02-02 22:40:55 +0400 |
commit | 38a1e8d3bd687088c2c804c47e082aaafe9e0f34 (patch) | |
tree | 260285109c0291a25233471781d51b9162a328b9 /mcs/class/WindowsBase | |
parent | 17fcfee696ac813e1fff6347f2d85b8a2de4085f (diff) |
Fix src and dest indexes in DispatcherOperation ctor
The source and the destination indexes are confused. The source index, which
is the second parameter, should be 0 and the destination index, which is the
fourth parameter, should be 1.
Diffstat (limited to 'mcs/class/WindowsBase')
-rw-r--r-- | mcs/class/WindowsBase/System.Windows.Threading/DispatcherOperation.cs | 2 | ||||
-rw-r--r-- | mcs/class/WindowsBase/Test/System.Windows.Threading/DispatcherTest.cs | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/mcs/class/WindowsBase/System.Windows.Threading/DispatcherOperation.cs b/mcs/class/WindowsBase/System.Windows.Threading/DispatcherOperation.cs index 34bb93df7f4..5c06c41ac26 100644 --- a/mcs/class/WindowsBase/System.Windows.Threading/DispatcherOperation.cs +++ b/mcs/class/WindowsBase/System.Windows.Threading/DispatcherOperation.cs @@ -70,7 +70,7 @@ namespace System.Windows.Threading { delegate_method = d; delegate_args = new object [args.Length + 1]; delegate_args [0] = arg; - Array.Copy (args, 1, delegate_args, 0, args.Length); + Array.Copy (args, 0, delegate_args, 1, args.Length); } internal void Invoke () diff --git a/mcs/class/WindowsBase/Test/System.Windows.Threading/DispatcherTest.cs b/mcs/class/WindowsBase/Test/System.Windows.Threading/DispatcherTest.cs index 629d3428947..614cef51a43 100644 --- a/mcs/class/WindowsBase/Test/System.Windows.Threading/DispatcherTest.cs +++ b/mcs/class/WindowsBase/Test/System.Windows.Threading/DispatcherTest.cs @@ -134,6 +134,21 @@ namespace MonoTests.System.Windows.Threading if (fail) throw new Exception ("Expected all states to run"); } + + [Test] + public void TestTwoArguments() + { + Dispatcher d = Dispatcher.CurrentDispatcher; + DispatcherFrame frame = new DispatcherFrame(); + + d.BeginInvoke (DispatcherPriority.Normal, (Action<int, string>) delegate(int arg1, string arg2) { + Assert.AreEqual(10, arg1, "arg1"); + Assert.AreEqual("OK", arg2, "arg2"); + frame.Continue = false; + }, 10, "OK"); + + Dispatcher.PushFrame(frame); + } } } |