Example #1
0
		/// <summary>
		/// Load the SourceSettings object for this source, with the specified source settings creator
		/// </summary>
		protected SourceSettings GetSettingsCore(SourceSettingsCreator sourceSettingsCreator)
		{
			if (String.IsNullOrEmpty(Name))
				throw new InvalidOperationException("Cannot load settings for a source with no name");

			return ((App)Application.Current).GetSourceSettings(Name, sourceSettingsCreator);
		}
Example #2
0
        public SourceSettings GetSourceSettings(string sourceName, SourceSettingsCreator sourceSettingsCreator)
        {
            SourceSettings sourceSettings;

            if (!mSourceSettings.TryGetValue(sourceName, out sourceSettings))
            {
                sourceSettings = sourceSettingsCreator(sourceName);
                if (mSettingsUpgradeRequired)
                {
                    sourceSettings.Upgrade();
                }

#if EPHEMERAL_SETTINGS
                sourceSettings.Reset();
#endif

                mSourceSettings.Add(sourceName, sourceSettings);
            }

            return(sourceSettings);
        }