/// <summary> /// Constructor for CacheController /// </summary> /// <param name="serviceUri">Remote sync service Uri with a trailing "/" parameter.</param> /// <param name="scopeName">The scope name being synchronized</param> /// <param name="localProvider">The OfflineSyncProvider instance for the local store.</param> public CacheController(Uri serviceUri, string scopeName, OfflineSyncProvider localProvider) { if (serviceUri == null) { throw new ArgumentNullException("serviceUri"); } if (string.IsNullOrEmpty(scopeName)) { throw new ArgumentNullException("scopeName"); } if (!serviceUri.Scheme.Equals("http", StringComparison.CurrentCultureIgnoreCase) && !serviceUri.Scheme.Equals("https", StringComparison.CurrentCultureIgnoreCase)) { throw new ArgumentException("Uri must be http or https schema", "serviceUri"); } if (localProvider == null) { throw new ArgumentNullException("localProvider"); } this.serviceUri = serviceUri; this.localProvider = localProvider; this.controllerBehavior = new CacheControllerBehavior(); this.controllerBehavior.ScopeName = scopeName; }
/// <summary> /// Constructor for CacheController /// </summary> /// <param name="serviceUri">Remote sync service Uri with a trailing "/" parameter.</param> /// <param name="scopeName">The scope name being synchronized</param> /// <param name="localProvider">The OfflineSyncProvider instance for the local store.</param> public CacheController(Uri serviceUri, string scopeName, OfflineSyncProvider localProvider) { if (serviceUri == null) { throw new ArgumentNullException("serviceUri"); } if (string.IsNullOrEmpty(scopeName)) { throw new ArgumentNullException("scopeName"); } if (!serviceUri.Scheme.Equals("http", StringComparison.InvariantCultureIgnoreCase) && !serviceUri.Scheme.Equals("https", StringComparison.InvariantCultureIgnoreCase)) { throw new ArgumentException("Uri must be http or https schema", "serviceUri"); } if (localProvider == null) { throw new ArgumentNullException("localProvider"); } this._serviceUri = serviceUri; this._localProvider = localProvider; this._controllerBehavior = new CacheControllerBehavior(); this._controllerBehavior.ScopeName = scopeName; }