示例#1
0
        private bool parseTimeZone(string timeZoneText, out Izual.Time startTime, out Izual.Time endTime)
        {
            var scrapTimeMatch = Regex.Match(timeZoneText, "(?<sHH>\\d{1,2}?):(?<smm>\\d{1,2}?)-(?<eHH>\\d{1,2}?):(?<emm>\\d{1,2}?)");

            if (scrapTimeMatch.Success)
            {
                var startHour = int.Parse(scrapTimeMatch.Groups["sHH"].Value);
                var startMin  = int.Parse(scrapTimeMatch.Groups["smm"].Value);
                var endHour   = int.Parse(scrapTimeMatch.Groups["eHH"].Value);
                var endMin    = int.Parse(scrapTimeMatch.Groups["emm"].Value);
                startTime = new Izual.Time(startHour, startMin, 0);
                endTime   = new Izual.Time(endHour, endMin, 0);
                return(true);
            }
            else
            {
                startTime = new Izual.Time(8, 0, 0);
                endTime   = new Izual.Time(18, 59, 0);
                return(false);
            }
        }
示例#2
0
        //public Dictionary<string, List<MatchedPolicy>> MatchedPolicyCache
        //{
        //    get
        //    {
        //        if (_context.Session["InterfaceMatchedPolicy"] != null)
        //        {
        //            return _context.Session["InterfaceMatchedPolicy"] as Dictionary<string, List<MatchedPolicy>>;
        //        }
        //        return new Dictionary<string, List<MatchedPolicy>>();
        //    }
        //    set
        //    {
        //        _context.Session["InterfaceMatchedPolicy"] = value;
        //    }
        //}

        private string getTimeRange(Izual.Time start, Izual.Time end)
        {
            return(start.ToString("HH:mm") + "-" + end.ToString("HH:mm"));
        }