public HangfireNumMod(string expression) { string[] spl = expression.Split(' '); if (spl.Length != 5) { throw new Exception("Parameter was not a valid cron expression, expression was longer than five items when split by ' '."); } if (spl[0].Contains('/')) { Mod = HangfireMod.Minute; Num = ReadCronNum(spl[0]); } else if (spl[1].Contains('/')) { Mod = HangfireMod.Hour; Num = ReadCronNum(spl[1]); } else if (spl[2].Contains('/')) { Mod = HangfireMod.Day; Num = ReadCronNum(spl[2]); } else if (spl[3].Contains('/')) { Mod = HangfireMod.Month; Num = ReadCronNum(spl[3]); } }
public void StringToMod(string mod) { if (mod == "Minutes") { Mod = HangfireMod.Minute; } else if (mod == "Hours") { Mod = HangfireMod.Hour; } else if (mod == "Days") { Mod = HangfireMod.Day; } else if (mod == "Months") { Mod = HangfireMod.Month; } }
public HangfireNumMod(int Num, HangfireMod Mod) { this.Num = Num; this.Mod = Mod; }