示例#1
0
        private void submitBtn_Click(object sender, EventArgs e)
        {
            XmlDocument doc = convForm.ExportToXml();

            MemoryStream      memStream = new MemoryStream();
            BZip2OutputStream bzStream  = new BZip2OutputStream(memStream);

            doc.Save(bzStream);
            bzStream.Close();
            memStream.Close();

            try
            {
                oSpyRepository.RepositoryService svc = new oSpyClassic.oSpyRepository.RepositoryService();
                string permalink = svc.SubmitTrace(nameTextBox.Text, descTextBox.Text, memStream.ToArray());

                ShareSuccessForm frm = new ShareSuccessForm(permalink);
                frm.ShowDialog(this);

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("Failed to submit visualization: {0}", ex.Message),
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        private void submitBtn_Click(object sender, EventArgs e)
        {
            XmlDocument doc = convForm.ExportToXml();

            MemoryStream memStream = new MemoryStream();
            BZip2OutputStream bzStream = new BZip2OutputStream(memStream);
            doc.Save(bzStream);
            bzStream.Close();
            memStream.Close();

            try
            {
                oSpyRepository.RepositoryService svc = new oSpyClassic.oSpyRepository.RepositoryService ();
                string permalink = svc.SubmitTrace(nameTextBox.Text, descTextBox.Text, memStream.ToArray());

                ShareSuccessForm frm = new ShareSuccessForm(permalink);
                frm.ShowDialog(this);

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("Failed to submit visualization: {0}", ex.Message),
                    "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }