コード例 #1
0
        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]);
            }
        }
コード例 #2
0
 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;
     }
 }
コード例 #3
0
 public HangfireNumMod(int Num, HangfireMod Mod)
 {
     this.Num = Num;
     this.Mod = Mod;
 }