Esempio n. 1
0
        public static void AppendEpisodeTitleRule(List <ScheduleRule> rules, TextRuleType textRuleType, string text)
        {
            text = (text ?? String.Empty).Trim();
            if (!String.IsNullOrEmpty(text))
            {
                switch (textRuleType)
                {
                case TextRuleType.Equals:
                    AppendORableRule(rules, ScheduleRuleType.SubTitleEquals, text);
                    break;

                case TextRuleType.StartsWith:
                    AppendORableRule(rules, ScheduleRuleType.SubTitleStartsWith, text);
                    break;

                case TextRuleType.Contains:
                    AppendContainsRule(rules, ScheduleRuleType.SubTitleContains, ScheduleRuleType.SubTitleDoesNotContain, text);
                    break;
                }
            }
        }
        public static void AppendEpisodeTitleRule(ScheduleRules rules, TextRuleType textRuleType, string text)
        {
            text = (text ?? String.Empty).Trim();
            if (!String.IsNullOrEmpty(text))
            {
                switch (textRuleType)
                {
                    case TextRuleType.Equals:
                        AppendORableRule(rules, ScheduleRuleType.SubTitleEquals, text);
                        break;

                    case TextRuleType.StartsWith:
                        AppendORableRule(rules, ScheduleRuleType.SubTitleStartsWith, text);
                        break;

                    case TextRuleType.Contains:
                        AppendContainsRule(rules, ScheduleRuleType.SubTitleContains, ScheduleRuleType.SubTitleDoesNotContain, text);
                        break;
                }
            }
        }
Esempio n. 3
0
 public static string GetEpisodeNumberRuleText(Schedule schedule, out TextRuleType typeIndex)
 {
     return(GetTitleRuleExpression(schedule.Rules, ScheduleRuleType.EpisodeNumberEquals, ScheduleRuleType.EpisodeNumberStartsWith,
                                   ScheduleRuleType.EpisodeNumberContains, ScheduleRuleType.EpisodeNumberDoesNotContain, out typeIndex));
 }
Esempio n. 4
0
        private static string GetTitleRuleExpression(List <ScheduleRule> rules, ScheduleRuleType equalsRule, ScheduleRuleType startsWithRule,
                                                     ScheduleRuleType containsRule, ScheduleRuleType doesNotContainRule, out TextRuleType typeIndex)
        {
            string expression = GetContainsExpression(rules, containsRule, doesNotContainRule);

            if (String.IsNullOrEmpty(expression))
            {
                typeIndex = TextRuleType.Equals;
                foreach (ScheduleRule rule in rules)
                {
                    if (rule.Type == equalsRule)
                    {
                        expression = JoinORedArguments(rule.Arguments);
                        break;
                    }
                    else if (rule.Type == startsWithRule)
                    {
                        expression = JoinORedArguments(rule.Arguments);
                        typeIndex  = TextRuleType.StartsWith;
                        break;
                    }
                }
            }
            else
            {
                typeIndex = TextRuleType.Contains;
            }
            return(expression);
        }
Esempio n. 5
0
 public static string GetTitleRuleText(Schedule schedule, out TextRuleType typeIndex)
 {
     return(GetTitleRuleExpression(schedule.Rules, ScheduleRuleType.TitleEquals, ScheduleRuleType.TitleStartsWith,
                                   ScheduleRuleType.TitleContains, ScheduleRuleType.TitleDoesNotContain, out typeIndex));
 }
 private static string GetTitleRuleExpression(ScheduleRules rules, ScheduleRuleType equalsRule, ScheduleRuleType startsWithRule,
     ScheduleRuleType containsRule, ScheduleRuleType doesNotContainRule, out TextRuleType typeIndex)
 {
     string expression = GetContainsExpression(rules, containsRule, doesNotContainRule);
     if (String.IsNullOrEmpty(expression))
     {
         typeIndex = TextRuleType.Equals;
         foreach (ScheduleRule rule in rules)
         {
             if (rule.Type == equalsRule)
             {
                 expression = JoinORedArguments(rule.Arguments);
                 break;
             }
             else if (rule.Type == startsWithRule)
             {
                 expression = JoinORedArguments(rule.Arguments);
                 typeIndex = TextRuleType.StartsWith;
                 break;
             }
         }
     }
     else
     {
         typeIndex = TextRuleType.Contains;
     }
     return expression;
 }
 public static string GetTitleRuleText(Schedule schedule, out TextRuleType typeIndex)
 {
     return GetTitleRuleExpression(schedule.Rules, ScheduleRuleType.TitleEquals, ScheduleRuleType.TitleStartsWith,
         ScheduleRuleType.TitleContains, ScheduleRuleType.TitleDoesNotContain, out typeIndex);
 }
 public static string GetEpisodeNumberRuleText(Schedule schedule, out TextRuleType typeIndex)
 {
     return GetTitleRuleExpression(schedule.Rules, ScheduleRuleType.EpisodeNumberEquals, ScheduleRuleType.EpisodeNumberStartsWith,
         ScheduleRuleType.EpisodeNumberContains, ScheduleRuleType.EpisodeNumberDoesNotContain, out typeIndex);
 }