예제 #1
0
        private void btnBlogsUser_Click(object sender, RoutedEventArgs e)
        {
            var blogsLogin = new WinBlogsLogin();

            blogsLogin.Owner = this;
            blogsLogin.ShowDialog();
        }
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtTitle.Text))
            {
                Common.ShowMessage("请输入标题");
                return;
            }

            Config.CurrBlogsDocument.Title = txtTitle.Text;
            this.Publish         = !(cbxPublish.IsChecked.HasValue && cbxPublish.IsChecked.Value);
            this.OpenWhenPublish = cbxOpen.IsChecked.HasValue && cbxOpen.IsChecked.Value;
            this.publishAsNew    = cbxPubAsNew.IsChecked.HasValue && cbxPubAsNew.IsChecked.Value;

            this.pwd = Config.Blogs.BlogsRecodPassword ? Tools.Decrypt(Config.Blogs.BlogsPassword) : "";
            if (string.IsNullOrEmpty(Config.Blogs.BlogsMetaweblogUrl) ||
                string.IsNullOrEmpty(Config.Blogs.BlogsUserId) ||
                string.IsNullOrEmpty(this.pwd))
            {
                Common.ShowMessage("需要配置用户信息!");
                WinBlogsLogin tmepDia = new WinBlogsLogin();
                tmepDia.Owner = this;
                var result = tmepDia.ShowDialog();
                if (!result.HasValue || !result.Value)
                {
                    return;//取消
                }
                this.pwd = tmepDia.txtPwd.Password;
            }

            btnOK.IsEnabled      = false;
            btnCancel.IsEnabled  = false;
            pane_input.IsEnabled = false;


            Start();
        }
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtTitle.Text))
            {
                Common.ShowMessage("请输入标题");
                return;
            }

            Config.CurrBlogsDocument.Title = txtTitle.Text;
            this.Publish = !(cbxPublish.IsChecked.HasValue && cbxPublish.IsChecked.Value);
            this.OpenWhenPublish = cbxOpen.IsChecked.HasValue && cbxOpen.IsChecked.Value;
            this.publishAsNew = cbxPubAsNew.IsChecked.HasValue && cbxPubAsNew.IsChecked.Value;

            this.pwd = Config.Blogs.BlogsRecodPassword ? Tools.Decrypt(Config.Blogs.BlogsPassword) : "";
            if (string.IsNullOrEmpty(Config.Blogs.BlogsMetaweblogUrl) ||
                string.IsNullOrEmpty(Config.Blogs.BlogsUserId) ||
                string.IsNullOrEmpty(this.pwd))
            {
                Common.ShowMessage("需要配置用户信息!");
                WinBlogsLogin tmepDia = new WinBlogsLogin();
                tmepDia.Owner = this;
                var result = tmepDia.ShowDialog();
                if (!result.HasValue || !result.Value)
                    return;//取消
                this.pwd = tmepDia.txtPwd.Password;
            }

            btnOK.IsEnabled = false;
            btnCancel.IsEnabled = false;
            pane_input.IsEnabled = false;

            Start();
        }
예제 #4
0
 private void btnBlogsUser_Click(object sender, RoutedEventArgs e)
 {
     var blogsLogin = new WinBlogsLogin();
     blogsLogin.Owner = this;
     blogsLogin.ShowDialog();
 }