/// <summary> /// Load feed options using the given option keys /// </summary> /// <param name="settingKeys">Feed Option Setting Keys</param> public void Load(IFeedOptionKeys settingKeys) { StoreSettingCollection settings = Token.Instance.Store.Settings; _CompressedFeedFileName = settings.GetValueByKey(settingKeys.CompressedFeedFileName); _FeedDataPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data\\Feeds"); _FeedFileName = settings.GetValueByKey(settingKeys.FeedFileName); _FtpHost = settings.GetValueByKey(settingKeys.FtpHost); _FtpPassword = settings.GetValueByKey(settingKeys.FtpPassword); _FtpUser = settings.GetValueByKey(settingKeys.FtpUser); _IncludeAllProducts = AlwaysConvert.ToBool(settings.GetValueByKey(settingKeys.IncludeAllProducts), false); _OverwriteCompressedFile = AlwaysConvert.ToBool(settings.GetValueByKey(settingKeys.OverwriteCompressedFile), true); _OverwriteFeedFile = AlwaysConvert.ToBool(settings.GetValueByKey(settingKeys.OverwriteFeedFile), true); _RemoteFileName = settings.GetValueByKey(settingKeys.RemoteFileName); IsDirty = false; }
/// <summary> /// Save the feed options using the given feed option keys /// </summary> /// <param name="settingKeys">Feed Option Setting Keys</param> public void Save(IFeedOptionKeys settingKeys) { if (IsDirty) { StoreSettingCollection settings = Token.Instance.Store.Settings; settings.SetValueByKey(settingKeys.CompressedFeedFileName, CompressedFeedFileName); settings.SetValueByKey(settingKeys.FeedFileName, FeedFileName); settings.SetValueByKey(settingKeys.FtpHost, FtpHost); settings.SetValueByKey(settingKeys.FtpPassword, FtpPassword); settings.SetValueByKey(settingKeys.FtpUser, FtpUser); settings.SetValueByKey(settingKeys.IncludeAllProducts, IncludeAllProducts.ToString()); settings.SetValueByKey(settingKeys.OverwriteCompressedFile, OverwriteCompressedFile.ToString()); settings.SetValueByKey(settingKeys.OverwriteFeedFile, OverwriteFeedFile.ToString()); settings.SetValueByKey(settingKeys.RemoteFileName, RemoteFileName); settings.Save(); } }