コード例 #1
0
 internal IsDayOffSettings(string apiBaseUrl,
                           string userAgent,
                           IIsDayOffCache cache,
                           Country defaultCountry,
                           bool useShortDays,
                           bool treatNonWorkingDaysByCovidAsWorkingDayAdvanced,
                           bool useSixDaysWorkWeek,
                           SourceLevels?traceLevel)
 {
     ApiBaseUrl     = apiBaseUrl;
     UserAgent      = userAgent;
     Cache          = cache;
     DefaultCountry = defaultCountry;
     UseShortDays   = useShortDays;
     TreatNonWorkingDaysByCovidAsWorkingDayAdvanced = treatNonWorkingDaysByCovidAsWorkingDayAdvanced;
     UseSixDaysWorkWeek = useSixDaysWorkWeek;
     TraceLevel         = traceLevel;
 }
コード例 #2
0
 /// <summary>
 /// Set up custom cache implementation
 /// </summary>
 /// <param name="newCache">Custom cache implementation</param>
 /// <exception cref="ArgumentNullException">Thrown when customCache is set to null</exception>
 /// <returns>Settings builder</returns>
 public IsDayOffSettingsBuilder UseCustomCache(IIsDayOffCache newCache)
 {
     cache = newCache ?? throw new ArgumentNullException(nameof(cache), ErrorsMessages.CacheCanNotBeNull());
     return(this);
 }
コード例 #3
0
 /// <summary>
 /// Set up to use built-in in-memory cache
 /// </summary>
 /// <returns>Settings builder</returns>
 public IsDayOffSettingsBuilder UseInMemoryCache()
 {
     cache = new IsDayOffInMemoryCache();
     return(this);
 }
コード例 #4
0
 public IsDayOffService(IIsDayOffApiClient apiClient, IIsDayOffCache cache)
 {
     this.apiClient = apiClient;
     this.cache     = cache;
 }