Esempio n. 1
0
        private string SelectSaveAsFilename(SupportedDocumentInfo docInfo)
        {
            try
            {
                using (System.Windows.Forms.SaveFileDialog dlg = new System.Windows.Forms.SaveFileDialog())
                {
                    dlg.AddExtension       = true;
                    dlg.AutoUpgradeEnabled = true;
                    dlg.DefaultExt         = docInfo.DialogExtension;
                    dlg.Filter             = docInfo.DialogFilter;
                    //dlg.InitialDirectory = "";
                    dlg.RestoreDirectory = true;
                    dlg.Title            = "";

                    if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        return(dlg.FileName);
                    }

                    return(string.Empty);
                }
            }
            catch (Exception err)
            {
                Tracer.Error("MainWindow.SelectSaveAsFilename", err);
                return(string.Empty);
            }
        }
 private void btnOk_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     this.DocumentTypeSelected = (SupportedDocumentInfo)this.listBoxDocType.SelectedItem;
     this.DialogResult         = true;
     this.Close();
 }
 private void btnCancel_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     this.DocumentTypeSelected = null;
     this.DialogResult         = false;
     this.Close();
 }