コード例 #1
0
ファイル: ProjectMigrator.cs プロジェクト: Deltares/Riskeer
        public MigrationRequired ShouldMigrate(string filePath)
        {
            if (filePath == null)
            {
                throw new ArgumentNullException(nameof(filePath));
            }

            ValidateProjectPath(filePath, nameof(filePath), Resources.ProjectMigrator_Source_Descriptor);

            var    versionedFile = new ProjectVersionedFile(filePath);
            string version       = versionedFile.GetVersion();

            if (version.Equals(currentDatabaseVersion))
            {
                return(MigrationRequired.No);
            }

            if (!fileMigrator.IsVersionSupported(version))
            {
                string errorMessage = string.Format(MigrationCoreStorageResources.Migrate_From_Version_0_To_Version_1_Not_Supported,
                                                    version, currentDatabaseVersion);
                log.Error(errorMessage);
                return(MigrationRequired.NotSupported);
            }

            string query = string.Format(Resources.ProjectMigrator_Migrate_Outdated_project_file_update_to_current_version_0_inquire,
                                         currentDatabaseVersion);

            if (inquiryHelper.InquireContinuation(query))
            {
                return(MigrationRequired.Yes);
            }

            GenerateMigrationCancelledLogMessage(filePath);
            return(MigrationRequired.Aborted);
        }
コード例 #2
0
 public bool InquireConfirmation()
 {
     return(inquiryHandler.InquireContinuation(query));
 }
 public bool InquireConfirmation()
 {
     return(inquiryHelper.InquireContinuation(Resources.ClearIllustrationPointsOfCalculation_InquireConfirmation));
 }
コード例 #4
0
 public bool InquireConfirmation()
 {
     return(inquiryHelper.InquireContinuation(GetConfirmationMessage()));
 }