Example #1
0
        private void mnuSend_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            sendContext = Stub.context.textData;
            backgroundWorker1.RunWorkerAsync();
            progressForm = new ProgressForm();
            progressForm.cancelBtn.Click += delegate(object send, EventArgs args) { Cancel(); };
            progressForm.Show();

            //String logMessage = String.Empty;
            //try
            //{
            //    MemoryStream stream = new MemoryStream();
            //    reg_editor.Document.SaveDocument(stream, DocumentFormat.Rtf);
            //    stream.Position = 0;
            //    Communicator.UploadContent(context, "application/rtf", stream);
            //    stream.Close();

            //    logMessage = "Сообщение отправлено!";
            //    reg_editor.Text = String.Empty;
            //}
            //catch (Exception ex)
            //{
            //    logMessage = "В процессе отправки произошла ошибка: " + ex.Message;
            //}

            //WriteLog(logMessage);
        }
Example #2
0
        private void mnuSendFile_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            sendContext = Stub.context.fileData;
            backgroundWorker1.RunWorkerAsync();
            progressForm = new ProgressForm();
            progressForm.cancelBtn.Click += delegate(object send, EventArgs args) { Cancel(); };
            progressForm.Show();

            //using (OpenFileDialog dlg = new OpenFileDialog())
            //{
            //    dlg.CheckPathExists = true;
            //    dlg.CheckFileExists = true;
            //    dlg.Multiselect = true;
            //    if (dlg.ShowDialog(this) == DialogResult.OK)
            //    {
            //        foreach (String fName in dlg.FileNames)
            //        {
            //            UploadFile(fName);
            //        }
            //    }
            //}
        }