internal ConfigurationBuilder(Configuration copyFrom) { _autoAliasingOptOut = copyFrom.AutoAliasingOptOut; _dataSourceFactory = copyFrom.DataSourceFactory; _diagnosticOptOut = copyFrom.DiagnosticOptOut; _enableBackgroundUpdating = copyFrom.EnableBackgroundUpdating; _evaluationReasons = copyFrom.EvaluationReasons; _eventProcessorFactory = copyFrom.EventProcessorFactory; _httpConfigurationBuilder = copyFrom.HttpConfigurationBuilder; _loggingConfigurationBuilder = copyFrom.LoggingConfigurationBuilder; _mobileKey = copyFrom.MobileKey; _offline = copyFrom.Offline; _persistenceConfigurationBuilder = copyFrom.PersistenceConfigurationBuilder; _serviceEndpointsBuilder = new ServiceEndpointsBuilder(copyFrom.ServiceEndpoints); }
/// <summary> /// Sets the SDK's persistent storage configuration, using a configuration builder obtained from /// <see cref="Components.Persistence()"/>. /// </summary> /// <remarks> /// <para> /// The persistent storage mechanism allows the SDK to immediately access the last known flag data /// for the user, if any, if it is offline or has not yet received data from LaunchDarkly. /// </para> /// <para> /// By default, the SDK uses a persistence mechanism that is specific to each platform: on Android and /// iOS it is the native preferences store, and in the .NET Standard implementation for desktop apps /// it is the <c>System.IO.IsolatedStorage</c> API. You may use the builder methods to substitute a /// custom implementation or change related parameters. /// </para> /// <para> /// This overwrites any previous options set with this method. If you want to set multiple options, /// set them on the same <see cref="PersistenceConfigurationBuilder"/>. /// </para> /// </remarks> /// <example> /// var config = Configuration.Builder("my-sdk-key") /// .Persistence(Components.Persistence().MaxCachedUsers(10)) /// .Build(); /// </example> /// <param name="persistenceConfigurationBuilder">a builder for persistence configuration</param> /// <returns>the top-level builder</returns> /// <seealso cref="Components.Persistence()" /> /// <seealso cref="Components.NoPersistence" /> /// <seealso cref="PersistenceConfigurationBuilder"/> public ConfigurationBuilder Persistence(PersistenceConfigurationBuilder persistenceConfigurationBuilder) { _persistenceConfigurationBuilder = persistenceConfigurationBuilder; return(this); }