示例#1
0
        private void ImportBtn_Click(object sender, EventArgs e)
        {
            if (string.Empty == folderIdBox.Text)
            {
                MessageBox.Show("Please select a valid folder from the folders tree");
                return;
            }
            var fileContent = string.Empty;
            var filePath    = string.Empty;

            try
            {
                using (OpenFileDialog openFileDialog = new OpenFileDialog())
                {
                    openFileDialog.InitialDirectory = Directory.GetCurrentDirectory();
                    openFileDialog.Filter           = "EWS files (*.ews)|*.ews";
                    openFileDialog.FilterIndex      = 1;
                    openFileDialog.RestoreDirectory = true;

                    if (openFileDialog.ShowDialog() == DialogResult.OK)
                    {
                        EwsHelper.UploadItem(folderIdBox.Text, openFileDialog.FileName);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
示例#2
0
 private void okBtn_Click(object sender, EventArgs e)
 {
     Properties.Settings.Default.USE_AUTODISCOVER        = useAutodiscoverBtn.Checked;
     Properties.Settings.Default.USE_SERVICE_URI         = useServiceUriBtn.Checked;
     Properties.Settings.Default.SERVICE_URI             = ewsUrlBox.Text;
     Properties.Settings.Default.USE_DEFAULT_CREDENTIALS = useDefaultCredentialsBox.Checked;
     Properties.Settings.Default.USERNAME          = usernameBox.Text;
     Properties.Settings.Default.PASSWORD          = passwordBox.Text;
     Properties.Settings.Default.EXCHANGE_VERSION  = exchangeVersionCombo.Text;
     Properties.Settings.Default.USE_IMPERSONATION = useImpersonationBox.Checked;
     Properties.Settings.Default.EMAIL_ADDRESS     = impersonateEmailBox.Text;
     Properties.Settings.Default.TRACING_ENABLED   = tracingOnBox.Checked;
     Properties.Settings.Default.Save();
     EwsHelper.Initialise();
     DialogResult = System.Windows.Forms.DialogResult.OK;
 }
示例#3
0
 private void ImportForm_Shown(object sender, EventArgs e)
 {
     folderTreeView.Nodes.Add(EwsHelper.GetFoldersTree());
 }