Commit b62a86e
Changed files (3)
trunk
product
MyMoney
Presentation
Views
trunk/product/MyMoney/Presentation/Views/core/ApplicationWindow.cs
@@ -1,4 +1,6 @@
using System;
+using System.ComponentModel;
+using System.Threading;
using System.Windows.Forms;
using MoMoney.Infrastructure.Extensions;
using MoMoney.Presentation.Resources;
@@ -15,11 +17,16 @@ namespace MoMoney.Presentation.Views.core
public partial class ApplicationWindow : Form, IApplicationWindow
{
+ protected readonly SynchronizationContext context;
+ AsyncOperation operation;
+
public ApplicationWindow()
{
InitializeComponent();
Icon = ApplicationIcons.Application;
this.log().debug("created {0}", GetType());
+ context = SynchronizationContext.Current;
+ operation = AsyncOperationManager.CreateOperation(null);
}
public IApplicationWindow create_tool_tip_for(string title, string caption, Control control)
@@ -38,6 +45,8 @@ namespace MoMoney.Presentation.Views.core
public IApplicationWindow top_most()
{
TopMost = true;
+ Focus();
+ BringToFront();
return this;
}
@@ -49,14 +58,16 @@ namespace MoMoney.Presentation.Views.core
protected void on_ui_thread(Action action)
{
- if (InvokeRequired)
- {
- BeginInvoke(action);
- }
- else
- {
- action();
- }
+ //context.Post(x => action(), new object());
+ operation.Post(x => action(), new object());
+ //if (InvokeRequired)
+ //{
+ // BeginInvoke(action);
+ //}
+ //else
+ //{
+ // action();
+ //}
}
}
}
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/Shell/ApplicationShell.cs
@@ -27,18 +27,15 @@ namespace MoMoney.Presentation.Views.Shell
};
}
-
protected override void OnLoad(EventArgs e)
{
try_to_reduce_flickering();
- TopMost = true;
- Focus();
- BringToFront();
+ //.top_most();
}
public void attach_to(IApplicationShellPresenter presenter)
{
- Closed += (sender, args) => presenter.shut_down();
+ Closed += (sender, args) => presenter.shut_down();
}
public void add(IDockedContentView view)
trunk/product/MyMoney/Presentation/Views/updates/CheckForUpdatesView.cs
@@ -1,4 +1,5 @@
-using System.Reflection;
+using System;
+using System.Reflection;
using System.Windows.Forms;
using MoMoney.Domain.Core;
using MoMoney.Presentation.Model.updates;