Exemple #1
0
        private void lstFileList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (lstFileList.SelectedItem == null)
            {
                return;
            }

            if (!System.IO.File.Exists(lstFileList.SelectedItem.ToString()))
            {
                Common.ShowMessage("文件不存在!");
                if (Config.Common.FileList.Contains(lstFileList.SelectedItem.ToString()))
                {
                    Config.Common.FileList.Remove(lstFileList.SelectedItem.ToString());
                }

                lstFileList.Items.Remove(lstFileList.SelectedItem);
            }
            else
            {
                OpenDoc(lstFileList.SelectedItem.ToString());
            }

            ribBackStage.IsOpen = false;
        }
        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();
        }