private void FillRulesAux(Inspector fInspector)
        {
            var inspector = fInspector as FileInspector;

            if (!inspector.Enable.HasValue || !inspector.CheckPeriod.HasValue)
                return;

            inspector.ImageEnable = inspector.Enable.Value ? @"/Resources/play.png" : @"/Resources/pausa.png";

            inspector.CheckPeriodText = InspectorDetail.GetPeriodText(inspector.CheckPeriod.Value) + " ";

            inspector.RulesAux = new List<InspectorHelper>(3);

            var queryRule = from rule in inspector.Rules.Value
                             where rule.RuleType.Equals((int)RuleFile.TypeFileRule.FileName)
                             select rule;

            var inspHelper = new InspectorHelper
                                 {
                                     CountRuleType = queryRule.Count(),
                                     Type = RuleFile.TypeFileRule.FileName,
                                     ImagePath = @"/images/icon_ruleFileName.png"
                                 };

            inspector.RulesAux.Add(inspHelper);

            queryRule = from rule in inspector.Rules.Value
                        where rule.RuleType.Equals((int)RuleFile.TypeFileRule.Extension)
                         select rule;

            inspHelper = new InspectorHelper
                             {
                                 CountRuleType = queryRule.Count(),
                                 Type = RuleFile.TypeFileRule.Extension,
                                 ImagePath = @"/images/icon_ruleFileExtension.png"
                             };

            inspector.RulesAux.Add(inspHelper);

            queryRule = from rule in inspector.Rules.Value
                        where rule.RuleType.Equals((int)RuleFile.TypeFileRule.Date)
                         select rule;

            inspHelper = new InspectorHelper
                             {
                                 CountRuleType = queryRule.Count(),
                                 Type = RuleFile.TypeFileRule.Date,
                                 ImagePath = @"/images/icon_ruleFileDate.png"
                             };

            inspector.RulesAux.Add(inspHelper);
        }
예제 #2
0
        private void FillRulesAux(Inspector inspector)
        {
            if (inspector.Enable)
            {
                inspector.ImageEnable = @"/Resources/play.png";
            }
            else
            {
                inspector.ImageEnable = @"/Resources/pausa.png";
            }

            inspector.CheckPeriodText = InspectorDetail.GetPeriodText(inspector.CheckPeriod) + " ";

            inspector.RulesAux = new List<InspectorHelper>(3);

            var queryRule = from rule in inspector.Rules
                             where rule.RuleType.Equals((int)RuleFile.TypeFileRule.FileName)
                             select rule;

            InspectorHelper inspHelper = new InspectorHelper();
            inspHelper.CountRuleType = queryRule.Count();
            inspHelper.Type = RuleFile.TypeFileRule.FileName;
            inspHelper.ImagePath = @"/images/icon_ruleFileName.png";

            inspector.RulesAux.Add(inspHelper);

            queryRule = from rule in inspector.Rules
                        where rule.RuleType.Equals((int)RuleFile.TypeFileRule.Extension)
                         select rule;

            inspHelper = new InspectorHelper();
            inspHelper.CountRuleType = queryRule.Count();
            inspHelper.Type = RuleFile.TypeFileRule.Extension;
            inspHelper.ImagePath = @"/images/icon_ruleFileExtension.png";

            inspector.RulesAux.Add(inspHelper);

            queryRule = from rule in inspector.Rules
                        where rule.RuleType.Equals((int)RuleFile.TypeFileRule.Date)
                         select rule;

            inspHelper = new InspectorHelper();
            inspHelper.CountRuleType = queryRule.Count();
            inspHelper.Type = RuleFile.TypeFileRule.Date;
            inspHelper.ImagePath = @"/images/icon_ruleFileDate.png";

            inspector.RulesAux.Add(inspHelper);
        }