public bool IsOnRec(int MarginMin = 0) { int StartMargin = RecSetting.GetTrueMargin(true) + 60 * MarginMin; int EndMargin = RecSetting.GetTrueMargin(false); DateTime startTime = StartTime.AddSeconds(StartMargin * -1); int duration = (int)DurationSecond + StartMargin + EndMargin; return(CtrlCmdDefEx.isOnTime(startTime, duration)); }
public void SetSettingNames(RecSetting recSetting) { IList <string> result = new List <string>(); try { var type = typeof(RecSetting); using (var writer = new StreamWriter(fileName)) { foreach (var prop in type.GetProperties()) { if ((bool)prop.GetValue(recSetting)) { writer.WriteLine(prop.Name); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public DateTime EndTimeWithMargin() { int EndMargin = RecSetting.GetTrueMargin(false); return(StartTime.AddSeconds((int)DurationSecond + EndMargin)); }
public DateTime StartTimeWithMargin(int MarginMin = 0) { int StartMargin = RecSetting.GetTrueMargin(true) + 60 * MarginMin; return(StartTime.AddSeconds(StartMargin * -1)); }
public SettingViewModel() { ExcelSetting = new RecSetting(); ExcelSetting = (RecSetting)_fileHelper.GetSettingNames(); }