private void OnLogin(object sender, MessageEventArgs e)
        {
            this.Invoke(new Action(() =>
            {
                this.Text = Resources.FormTitle + @" - " + e.Message;
                this.account = e.Account;

                if (this.account != AccountTypes.Admin)
                {
                    MessageBox.Show(Resources.UseAdminLoginMessage, Resources.InfoTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.webView.FrameLoadEnd += this.WebViewOnLoginFrameLoadEnd;
                    this.webView.ExecuteScriptAsync("parent.logout();");
                }

                this.btnDownloadDoc.Enabled = this.account == AccountTypes.Admin;
            }));
        }
 private void OnLogin(object sender, MessageEventArgs e)
 {
     this.Invoke(new Action(() =>
     {
         this.Text = Resources.FormTitle + @" - " + e.Message;
         this.account = e.Account;
         this.LstCategorySelectedIndexChanged(this, EventArgs.Empty);
     }));
 }