Beispiel #1
0
 /// <summary>
 /// Shows the new file form to create a word document
 /// </summary>
 private void showNewFileDialogForWordDoc()
 {
     _newFileNameForm                     = new NewFileNameForm();
     _newFileNameForm.EvtDone            += _newFileNameForm_EvtDone;
     _newFileNameForm.CreateFileType      = NewFileNameForm.FileType.Word;
     _newFileNameForm.CreateFileDirectory = SmartPath.ACATNormalizePath(Common.AppPreferences.NewWordDocCreateFolder);
     _newFileNameForm.ShowDialog();
 }
Beispiel #2
0
 /// <summary>
 /// Shows the new file form to create a text file
 /// </summary>
 private void showNewFileDialogForTextFile()
 {
     _newFileNameForm                     = new NewFileNameForm();
     _newFileNameForm.EvtDone            += new NewFileNameForm.DoneEvent(_newFileNameForm_EvtDone);
     _newFileNameForm.CreateFileType      = NewFileNameForm.FileType.Text;
     _newFileNameForm.CreateFileDirectory = SmartPath.ACATNormalizePath(Common.AppPreferences.NewTextFileCreateFolder);
     _newFileNameForm.Show();
 }
Beispiel #3
0
 /// <summary>
 /// Shows the new file form to create a text file
 /// </summary>
 private void showNewFileDialogForTextFile()
 {
     _newFileNameForm                     = new NewFileNameForm();
     _newFileNameForm.EvtDone            += _newFileNameForm_EvtDone;
     _newFileNameForm.CreateFileType      = NewFileNameForm.FileType.Text;
     _newFileNameForm.CreateFileDirectory = SmartPath.ACATNormalizePath(Settings.NewTextFileCreateFolder);
     _newFileNameForm.ShowDialog();
 }
Beispiel #4
0
        /// <summary>
        /// Checks if the specified folder is valid
        /// Display error if is not valid
        /// </summary>
        /// <param name="folder">Name of folder</param>
        /// <returns>true on success</returns>
        private bool checkValidOrCreate(String folder)
        {
            var normalizedFolder = SmartPath.ACATNormalizePath(folder);

            if (Directory.Exists(normalizedFolder))
            {
                return(true);
            }

            try
            {
                Directory.CreateDirectory(normalizedFolder);
                return(true);
            }
            catch (Exception)
            {
                DialogUtils.ShowTimedDialog(
                    Context.AppPanelManager.GetCurrentForm() as Form,
                    Resources.Error,
                    string.Format(Resources.CouldNotCreateFolder0, normalizedFolder));
            }

            return(false);
        }