예제 #1
0
파일: Library.cs 프로젝트: jonnybest/coapp
 public Library(Rule rule)
     : base(rule)
 {
 }
예제 #2
0
 public ProductInfo(Rule rule)
     : base(rule)
 {
 }
예제 #3
0
파일: Link.cs 프로젝트: segilbert/coapp
 public Link(Rule rule)
     : base(rule)
 {
 }
예제 #4
0
 public FileGroup(Rule rule)
     : base(rule)
 {
     Files = new DictionaryProperty(Rule, "files");
 }
예제 #5
0
 public Event(Rule rule)
     : base(rule)
 {
 }
예제 #6
0
 public Process(Rule rule)
     : base(rule)
 {
 }
예제 #7
0
        public SpecFile()
        {
            FileGroups = new Indexer<FileGroup>(
                () => from rule in FileGroupRules select rule.Parameter ?? rule.Name,
                ruleName => from rule in FileGroupRules where (rule.Name == ruleName || rule.Parameter == ruleName) select rule,
                ruleName => {
                    var rule = new Rule {
                        Name = ruleName
                    };
                    _rules.Add(rule.FullSelector, rule);
                    return rule;
                });

            Processes = new Indexer<Process>(
                () => from rule in ProcessRules select rule.Parameter,
                parameter => from rule in ProcessRules where rule.Parameter.Equals( parameter, StringComparison.CurrentCultureIgnoreCase) select rule,
                parameter => {
                    var rule = new Rule {
                        Class = "process",
                        Parameter = parameter
                    };
                    _rules.Add(rule.FullSelector, rule);
                    return rule;
                });

            Events = new Indexer<Event>(
                () => from rule in EventRules select rule.Id,
                id => from rule in EventRules where rule.Id == id select rule,
                id => {
                    var rule = new Rule {
                        Class = "event",
                        Id = EventRules.Max(each => each.Id)+1
                    };
                    _rules.Add(rule.FullSelector, rule);
                    return rule;
                });

            Libraries = new Indexer<Library>(
                () => from rule in LibraryRules select rule.Parameter,
                parameter => from rule in LibraryRules where rule.Parameter == parameter select rule,
                parameter => {
                    var rule =new Rule {
                        Name = "library",
                        Parameter = parameter
                    };
                    _rules.Add(rule.FullSelector, rule);
                    return rule;
                });

               _link= new Indexer<Link>(
                () => "unique".SingleItemAsEnumerable(),
                unique => LinkRules,
                unique => {
                    var rule = new Rule {
                        Class = "link"
                    };
                    _rules.Add(rule.FullSelector, rule);
                    return rule;
                });

                _productInfo= new Indexer<ProductInfo>(
                () => "unique".SingleItemAsEnumerable(),
                unique => ProductInfoRules,
                unique => {
                    var rule = new Rule {
                        Id = "product-info"
                    };
                    _rules.Add(rule.FullSelector, rule);
                    return rule;
                });
        }