Settings.cs
1 // Copyright (c) Microsoft Corporation 2 // The Microsoft Corporation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 using System.Collections.Generic; 6 using Microsoft.CmdPal.Ext.TimeDate.Helpers; 7 8 namespace Microsoft.CmdPal.Ext.TimeDate.UnitTests; 9 10 public class Settings : ISettingsInterface 11 { 12 private readonly int firstWeekOfYear; 13 private readonly int firstDayOfWeek; 14 private readonly bool enableFallbackItems; 15 private readonly bool timeWithSecond; 16 private readonly bool dateWithWeekday; 17 private readonly List<string> customFormats; 18 19 public Settings( 20 int firstWeekOfYear = -1, 21 int firstDayOfWeek = -1, 22 bool enableFallbackItems = true, 23 bool timeWithSecond = false, 24 bool dateWithWeekday = false, 25 List<string> customFormats = null) 26 { 27 this.firstWeekOfYear = firstWeekOfYear; 28 this.firstDayOfWeek = firstDayOfWeek; 29 this.enableFallbackItems = enableFallbackItems; 30 this.timeWithSecond = timeWithSecond; 31 this.dateWithWeekday = dateWithWeekday; 32 this.customFormats = customFormats ?? new List<string>(); 33 } 34 35 public int FirstWeekOfYear => firstWeekOfYear; 36 37 public int FirstDayOfWeek => firstDayOfWeek; 38 39 public bool EnableFallbackItems => enableFallbackItems; 40 41 public bool TimeWithSecond => timeWithSecond; 42 43 public bool DateWithWeekday => dateWithWeekday; 44 45 public List<string> CustomFormats => customFormats; 46 }