Example #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="BackupProjectDlg"/> class.
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="appAbbrev">The command-line abbreviation for the application displaying
		/// this backup dialog box.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public BackupProjectDlg(FdoCache cache, string appAbbrev,
			IHelpTopicProvider helpTopicProvider) : this()
		{
			m_cache = cache;
			m_helpTopicProvider = helpTopicProvider;

			m_presenter = new BackupProjectPresenter(this, appAbbrev, m_cache);

			//It should only be displayed if the SupportingFiles folder has content.
			if (!m_presenter.SupportingFilesFolderContainsFiles)
			{
				m_supportingFiles.Enabled = false;
			}

			DestinationFolder = FwDirectoryFinder.DefaultBackupDirectory;
			if (File.Exists(m_presenter.PersistanceFilePath))
			{
				// If something bad happens when loading the previous dialog settings (probably just a
				// pre-7.0 version), just log the error and use the defaults.
				ExceptionHelper.LogAndIgnoreErrors(() =>
				{
					//If the dialog settings file does exist then read it in and set the dialog to match
					//the last values set.
					using (FileStream fs = new FileStream(m_presenter.PersistanceFilePath, FileMode.Open))
					{
						IBackupSettings backupSettings = BackupFileSettings.CreateFromStream(fs);
						// Per FWR-2748, we do NOT want to copy a previous comment into the dialog.
						//Comment = backupSettings.Comment;
						//Show SupportingFiles, unchecked by default
						//SupportingFiles = backupSettings.IncludeSupportingFiles;
						IncludeConfigurationSettings = backupSettings.IncludeConfigurationSettings;
						IncludeLinkedFiles = backupSettings.IncludeLinkedFiles;
					}
				});
			}
		}
Example #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="BackupProjectDlg"/> class.
        /// </summary>
        /// <param name="cache">The cache.</param>
        /// <param name="helpTopicProvider">The help topic provider.</param>
        /// ------------------------------------------------------------------------------------
        public BackupProjectDlg(LcmCache cache,
                                IHelpTopicProvider helpTopicProvider) : this()
        {
            m_cache             = cache;
            m_helpTopicProvider = helpTopicProvider;

            m_presenter = new BackupProjectPresenter(this, m_cache);

            //It should only be displayed if the SupportingFiles folder has content.
            if (!m_presenter.SupportingFilesFolderContainsFiles)
            {
                m_supportingFiles.Enabled = false;
            }

            DestinationFolder = FwDirectoryFinder.DefaultBackupDirectory;
            if (File.Exists(m_presenter.PersistanceFilePath))
            {
                // If something bad happens when loading the previous dialog settings (probably just a
                // pre-7.0 version), just log the error and use the defaults.
                ExceptionHelper.LogAndIgnoreErrors(() =>
                {
                    //If the dialog settings file does exist then read it in and set the dialog to match
                    //the last values set.
                    using (FileStream fs = new FileStream(m_presenter.PersistanceFilePath, FileMode.Open))
                    {
                        IBackupSettings backupSettings = BackupFileSettings.CreateFromStream(fs);
                        // Per FWR-2748, we do NOT want to copy a previous comment into the dialog.
                        //Comment = backupSettings.Comment;
                        //Show SupportingFiles, unchecked by default
                        //SupportingFiles = backupSettings.IncludeSupportingFiles;
                        IncludeConfigurationSettings = backupSettings.IncludeConfigurationSettings;
                        IncludeLinkedFiles           = backupSettings.IncludeLinkedFiles;
                    }
                });
            }
        }