Exemplo n.º 1
0
 public static string ToJsonText(IWorkdayModify @this)
 {
     return JsonConvert.SerializeObject(@this, new JsonSerializerSettings() { Formatting = Newtonsoft.Json.Formatting.Indented });
 }
Exemplo n.º 2
0
        public void Save(IWorkdayModify workdayModify)
        {
            if (Directory.Exists(Path.GetDirectoryName(this.filePath)) == false)
            {
                Directory.CreateDirectory(Path.GetDirectoryName(this.filePath));
            }

            using (var fs = new FileStream(this.filePath, FileMode.Create))
            using (var w = new StreamWriter(fs))
            {
                var json = WorkdayModify.ToJsonText(workdayModify);
                w.Write(json);
            }
        }
Exemplo n.º 3
0
 public static IWorkdayModify New(IWorkdayModify source)
 {
     return new WorkdayModify
     {
         ModifyDays = source.ModifyDays,
         IsHolidayWeekEnd = source.IsHolidayWeekEnd,
     };
 }