public static string ToJsonText(IWorkdayModify @this) { return JsonConvert.SerializeObject(@this, new JsonSerializerSettings() { Formatting = Newtonsoft.Json.Formatting.Indented }); }
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); } }
public static IWorkdayModify New(IWorkdayModify source) { return new WorkdayModify { ModifyDays = source.ModifyDays, IsHolidayWeekEnd = source.IsHolidayWeekEnd, }; }