/// <summary> /// Enables the DataRepository to programatically create and /// pass in a <c>NetTiersProvider</c> during runtime. /// </summary> /// <param name="provider">An instatiated NetTiersProvider.</param> /// <param name="setAsDefault">ability to set any valid provider as the default provider for the DataRepository.</param> public static void LoadProvider(Shmzh.Components.SystemComponent.Provider provider, bool setAsDefault) { if (provider == null) throw new ArgumentNullException("provider"); if (_providers == null) { lock (SyncRoot) { if (_providers == null) _providers = new Shmzh.Components.SystemComponent.ProviderCollection(); } } if (_providers[provider.Name] == null) { lock (_providers.SyncRoot) { _providers.Add(provider); } } if (_provider == null || setAsDefault) { lock (SyncRoot) { if (_provider == null || setAsDefault) _provider = provider as DataProvider; } } }
/// <summary> /// Enables the DataRepository to programatically create and /// pass in a <c>NetTiersProvider</c> during runtime. /// </summary> /// <param name="provider">An instatiated NetTiersProvider.</param> public static void LoadProvider(Shmzh.Components.SystemComponent.Provider provider) { LoadProvider(provider, false); }