Exemplo n.º 1
0
 public virtual void SaveFile(OpenedFile file, string defaultExtension, string initialDirectory, Dictionary <string, string> filters,
                              string dialogTitle = "Save File", bool addExtension = true, bool checkFileExists = false, bool checkPathExists = true)
 {
     if (file.IsUntitled)
     {
         SaveFileAs(file, defaultExtension, initialDirectory, filters, dialogTitle, addExtension, checkFileExists, checkPathExists);
     }
     else
     {
         file.SaveToDisk();
     }
 }
Exemplo n.º 2
0
        public virtual void SaveFileAs(OpenedFile file, string defaultExtension, string initialDirectory, Dictionary <string, string> filters,
                                       string dialogTitle = "Save File", bool addExtension = true, bool checkFileExists = false, bool checkPathExists = true)
        {
            string fileName = FileDialogService.SaveFileDialog(
                file.FileName,
                defaultExtension, initialDirectory, filters,
                dialogTitle,
                addExtension, checkFileExists, checkPathExists);

            if (fileName != null)
            {
                file.FileName = FileName.Create(fileName);
                file.SaveToDisk();
            }
        }