예제 #1
0
        private bool SaveOrSaveAs(bool saveAs)
        {
            L3dFilePath p;

            if (saveAs || L3dFilePath.IsNullOrEmpty(CurrentFile.OwnPath))
            {
                p = DialogHelpers.SaveLoksimFile(CurrentFile.OwnPath, FileExtensionForSaveAs, SAVEAS_DLG_GUID);
            }
            else
            {
                p = CurrentFile.OwnPath;
            }

            try
            {
                if (p != null)
                {
                    CurrentFile.SaveToFile(p);
                    return(true);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format(CultureInfo.CurrentCulture, Resources.Strings.FileSaveError, CurrentFile.OwnPath, ex.Message),
                                Resources.Strings.AppName, System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
            }
            return(false);
        }