diff options
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); + } } } |