Esempio n. 1
0
 private async void FrmMain_Load(object sender, EventArgs e)
 {
     await SafeExecutionContext.ExecuteAsync(
         this,
         async () =>
         {
             this.lblTitle.Text = string.Empty;
             this.lblDatePublished.Text = string.Empty;
             this.htmlEditor.Html = EmptyContent;
             this.htmlEditor.Enabled = false;
             if (this.mnuSaveAs != null)
             {
                 this.mnuSaveAs.Enabled = false;
             }
             var desktopClientService = new DesktopClientService(this.settings);
             this.checkUpdateResult = await desktopClientService.CheckUpdateAsync();
             this.slblUpdateAvailable.Visible = this.checkUpdateResult.HasUpdate;
             await this.LoadNotesAsync();
         },
         () =>
         {
             this.slblStatus.Text = Resources.Loading;
             this.sp.Visible = true;
         },
         () => this.sp.Visible = false);
 }
Esempio n. 2
0
 private async void FrmLogin_Shown(object sender, EventArgs e)
 {
     var desktopClientService = new DesktopClientService(this.settings);
     var checkUpdateResult = await desktopClientService.CheckUpdateAsync();
     lblNewVersionNotify.Visible = checkUpdateResult.HasUpdate;
     this.availablePackage = checkUpdateResult.UpdatePackage;
 }