コード例 #1
0
        void BtnGetDocClick(object sender, EventArgs e)
        {
            string db = GetSelectedDB();

            if (db == "")
            {
                return;
            }
            DocIDForm f = new DocIDForm();

            if (f.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    string doc = mDB.GetDocument(txtServer.Text, db, f.DocID);
                    // This output really needs formatting, but for now we will just
                    // replace the unix line breaks with windows ones...
                    doc = doc.Replace("\n", "\r\n");
                    ResultForm f2 = new ResultForm(doc);
                    f2.Show();
                }
                catch (Exception ex)
                {
                    StatusBar.Items[0].Text = ex.Message;
                }
            }
        }
コード例 #2
0
        void BtnDeleteDocClick(object sender, EventArgs e)
        {
            string db = GetSelectedDB();

            if (db == "")
            {
                return;
            }
            DocIDForm f = new DocIDForm();

            if (f.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    mDB.DeleteDocument(txtServer.Text, db, f.DocID);
                    StatusBar.Items[0].Text = "Document deleted";
                }
                catch (Exception ex)
                {
                    StatusBar.Items[0].Text = ex.Message;
                }
            }
            UpdateDocCount();
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: nasirg80/couchbrowse
 void BtnDeleteDocClick(object sender, EventArgs e)
 {
     string db=GetSelectedDB();
     if(db=="") return;
     DocIDForm f=new DocIDForm();
     if(f.ShowDialog()==DialogResult.OK)
     {
         try
         {
             mDB.DeleteDocument(txtServer.Text,db,f.DocID);
             StatusBar.Items[0].Text="Document deleted";
         }
         catch(Exception ex)
         {
             StatusBar.Items[0].Text=ex.Message;
         }
     }
     UpdateDocCount();
 }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: nasirg80/couchbrowse
 void BtnGetDocClick(object sender, EventArgs e)
 {
     string db=GetSelectedDB();
     if(db=="") return;
     DocIDForm f=new DocIDForm();
     if(f.ShowDialog()==DialogResult.OK)
     {
         try
         {
             string doc=mDB.GetDocument(txtServer.Text,db,f.DocID);
             // This output really needs formatting, but for now we will just
             // replace the unix line breaks with windows ones...
             doc=doc.Replace("\n","\r\n");
             ResultForm f2=new ResultForm(doc);
             f2.Show();
         }
         catch(Exception ex)
         {
             StatusBar.Items[0].Text=ex.Message;
         }
     }
 }