예제 #1
0
        public RuleField(XmlNode node, Protocol p)
        {
            if (node.Attributes["name"] != null)
                name = node.Attributes["name"].Value;
            else
                name = "";

            type = node.Attributes["type"].Value;

            if (node.Attributes["value"] != null)
            {
                value = Expression.fromString(node.Attributes["value"].Value);
            }
        }
예제 #2
0
 public RuleMatch(XmlNode node, Protocol proto)
 {
     if (node.Attributes["name"] != null)
     {
         // <match name=... value=... />
         Expression var = new VariableExpression("$" + node.Attributes["name"].Value);
         Expression value = Expression.fromString(node.Attributes["value"].Value);
         myExpr = new FunctionCallExpression("==", new List<Expression>(new Expression[] { var, value }));
     }
     else
     {
         // <match_expr>...</match_expr>
         myExpr = Expression.fromString(node.InnerText);
     }
 }
예제 #3
0
파일: RuleSet.cs 프로젝트: ktosiek/ProtoToy
 public RuleSet(XmlNode node, Protocol proto)
 {
     name = node.Attributes["name"].Value;
     value = Expression.fromString(node.Attributes["value"].Value);
 }