Example #1
0
        private static bool DoLogin()
        {
            if (LoginFrm.IsDialogVisible)
            {
                return(false);
            }

            if ((mainForm != null) && (mainForm.InvokeRequired))
            {
                return((bool)mainForm.Invoke(new LoginDelegate(DoLogin)));
            }
            else
            {
                FormWait.HideWaitForm();

                if (LoginFrm.ShowLogin(mainForm) != DialogResult.OK)
                {
                    Application.Exit();
                    return(false);
                }

                FormWait.ShowWaitForm();

                DoInitServices();
                OnIdleService.AddTask(new OnIdleOneRunTask(NotificationService.RunDataCheck));
            }
            return(true);
        }
Example #2
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (!DesignMode)
     {
         AssignLanguage();
         LoadLanguages();
         Text =
             string.Format("{0} - '{1}'", GetLocalized("MainWindowCaption"),
                           ClientEnvironment.AuthorizationService.GetCurrentUser().LoginName);
         FormWait.HideWaitForm();
     }
 }
Example #3
0
        private static void GenuineGlobalEventProvider_GenuineChannelsGlobalEvent(object sender, GenuineEventArgs e)
        {
            switch (e.EventType)
            {
            case GenuineEventType.HostResourcesReleased:
                if (!DoLogin())
                {
                    return;
                }
                FormWait.HideWaitForm();
                break;

            default:
                log.Debug(string.Format("{0} - GenuineChannelsGlobalEvent: {1}", e.HostInformation.Url, e.EventType));
                break;
            }
        }
Example #4
0
 public static void ShowWaitForm()
 {
     if (_WaitWorker == null)
     {
         _FinishEvent.Reset();
         _WaitWorker = new Thread(
             delegate()
                 {
                     using (FormWait _WaitFrm = new FormWait())
                     {
                         _WaitFrm.Show();
                         while (!_FinishEvent.WaitOne(25, false))
                             Application.DoEvents();
                     }
                 });
         _WaitWorker.SetApartmentState(ApartmentState.STA);
         _WaitWorker.IsBackground = true;
         _WaitWorker.Start();
     }
 }
Example #5
0
 public static void ShowWaitForm()
 {
     if (_WaitWorker == null)
     {
         _FinishEvent.Reset();
         _WaitWorker = new Thread(
             delegate()
         {
             using (FormWait _WaitFrm = new FormWait())
             {
                 _WaitFrm.Show();
                 while (!_FinishEvent.WaitOne(25, false))
                 {
                     Application.DoEvents();
                 }
             }
         });
         _WaitWorker.SetApartmentState(ApartmentState.STA);
         _WaitWorker.IsBackground = true;
         _WaitWorker.Start();
     }
 }