Example #1
0
 public virtual void ShowNagScreen(bool modal = false, string nagMessage = null)
 {
     ExecuteInUIFriendlyContext(
         () => {
         if (_nagDialogInstance == null)
         {
             _nagDialogInstance = ComponentRegistry.Instance.Resolve <INagDialog>();
             var parent         = ApplicationServices.PrimaryUIController as IWin32Window;
             if (parent != null && parent is Form && ((Form)parent).WindowState == FormWindowState.Minimized)
             {
                 _nagDialogInstance.StartPosition = FormStartPosition.CenterScreen;
             }
             _nagDialogInstance.ShowDialog(parent);
             _nagDialogInstance = null;
         }
         else
         {
             // this is being entered by non-UI thread, what if closed at this point?
             if (_nagDialogInstance.Visible)
             {
                 _nagDialogInstance.Refresh();
             }
         }
     },
         executeAsync: !modal
         );
 }
Example #2
0
 public LiteMainForm()
 {
     System.Windows.Forms.Application.ThreadException += ApplicationOnThreadException;
     InitializeComponent();
     Nagged             = false;
     _nagDialogInstance = null;
     NumberActivations  = 0;
 }