/// <summary> /// Gets a rule by the selector criteria. If the rule doesn't exists, it creates it and adds it to the propertysheet. /// </summary> /// <param name="name"></param> /// <param name="parameter"></param> /// <param name="class"></param> /// <param name="id"></param> /// <returns></returns> public Rule GetRule( string name = "*" , string parameter = null, string @class = null , string id = null ) { var r = (from rule in Rules where rule.Name == name && (string.IsNullOrEmpty(parameter) ? null : parameter) == rule.Parameter && (string.IsNullOrEmpty(@class) ? null : @class) == rule.Class && (string.IsNullOrEmpty(id) ? null : id) == rule.Id select rule).FirstOrDefault(); if( r == null ) { _rules.Add(r = new Rule(this) { Name = name, Parameter = parameter, Class = @class, Id = id, }); } return r; }
public Rule AddRule(string name = "*", string parameter = null, string @class = null, string id = null) { Rule result; _rules.Insert(0, result = new Rule(this) { Name = name, Parameter = parameter, Class = @class, Id = id, }); return result; }
/// <summary> /// RuleProperty object must be created by the Rule. /// </summary> /// <param name="parent"> </param> /// <param name="name"> </param> internal PropertyRule(Rule parent, string name) { ParentRule = parent; Name = name; }
public EndUserRuleException(Rule rule, string errorcode, string message, params object[] parameters) : base("{0}({1},{2}):{3}:{4}".format(rule.SourceLocation.SourceFile, rule.SourceLocation.Row, rule.SourceLocation.Column, errorcode, message.format(parameters))) { Rule = rule; }
protected PropertyRule(Rule parent, string name) { ParentRule = parent; Name = name; }
/// <summary> /// RuleProperty object must be created by the Rule. /// </summary> /// <param name="parent"> </param> /// <param name="name"> </param> internal StandardPropertyRule(Rule parent, string name) : base(parent, name) { }
internal ScriptedPropertyRule(Rule parent, string name, string scriptType, string scriptText, string sourceText ) : base(parent, name) { ScriptType = scriptType; ScriptText = scriptText; }