Пример #1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="BackupFileSettings"/> class from an
 /// existing BackupProjectSettings object
 /// </summary>
 /// <param name="settings">The BackupProjectSettings.</param>
 /// ------------------------------------------------------------------------------------
 private BackupFileSettings(BackupProjectSettings settings)
 {
     m_backupTime              = settings.BackupTime;
     m_comment                 = settings.Comment;
     m_configurationSettings   = settings.IncludeConfigurationSettings;
     m_supportingFiles         = settings.IncludeSupportingFiles;
     m_linkedFiles             = settings.IncludeLinkedFiles;
     m_projectName             = settings.ProjectName;
     m_projectPathPersisted    = LcmFileHelper.GetPathWithoutRoot(settings.ProjectPath);
     m_spellCheckAdditions     = settings.IncludeSpellCheckAdditions;
     m_dbVersion               = settings.DbVersion;
     m_fwVersion               = settings.FwVersion;
     m_linkedFilesPathRelative = LinkedFilesRelativePathHelper.GetLinkedFilesRelativePathFromFullPath(settings.ProjectsRootFolder, settings.LinkedFilesPath, settings.ProjectPath, settings.ProjectName);
     m_linkedFilesPathActual   = settings.LinkedFilesPath;
 }
Пример #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Writes out the given backup settings to the given stream, which will normally
        /// be a file, but for testing we can use a memory stream.
        /// </summary>
        /// <param name="settings">The settings to persist.</param>
        /// <param name="stream">The persistence stream.</param>
        /// ------------------------------------------------------------------------------------
        public static void SaveToStream(BackupProjectSettings settings, Stream stream)
        {
            DataContractSerializer serializer = new DataContractSerializer(typeof(BackupFileSettings));

            serializer.WriteObject(stream, new BackupFileSettings(settings));
        }
Пример #3
0
 ///<summary>
 /// Constructor
 ///</summary>
 public ProjectBackupService(LcmCache cache, BackupProjectSettings settings)
 {
     m_cache    = cache;
     m_settings = settings;
 }