Exemplo n.º 1
0
        public new static OrExpression Deserialize(Stream ms, Vehicle vec)
        {
            byte[] bytes = BitConverter.GetBytes(0);
            ms.Read(bytes, 0, bytes.Length);
            int          num          = BitConverter.ToInt32(bytes, 0);
            OrExpression orExpression = new OrExpression();

            for (int i = 0; i < num; i++)
            {
                orExpression.AddOperand(RuleExpression.Deserialize(ms, vec));
            }
            return(orExpression);
        }
Exemplo n.º 2
0
        public static RuleExpression Deserialize(Stream ms, Vehicle vec)
        {
            EExpressionType type = (EExpressionType)((byte)ms.ReadByte());

            switch (type)
            {
            case EExpressionType.COMP:
                return(CompareExpression.Deserialize(ms, vec));

            case EExpressionType.AND:
                return(AndExpression.Deserialize(ms, vec));

            case EExpressionType.OR:
                return(OrExpression.Deserialize(ms, vec));

            case EExpressionType.NOT:
                return(NotExpression.Deserialize(ms, vec));

            case EExpressionType.DATE:
                return(DateExpression.Deserialize(ms, vec));

            case EExpressionType.ISTUFE:
            case EExpressionType.VALID_FROM:
            case EExpressionType.VALID_TO:
            case EExpressionType.COUNTRY:
            case EExpressionType.ECUGROUP:
            case EExpressionType.ECUVARIANT:
            case EExpressionType.ECUCLIQUE:
            case EExpressionType.EQUIPMENT:
            case EExpressionType.SALAPA:
            case EExpressionType.SIFA:
            case EExpressionType.ECUREPRESENTATIVE:
            case EExpressionType.ECUPROGRAMMINGVARIANT:
                return(SingleAssignmentExpression.Deserialize(ms, type, vec));

            case EExpressionType.CHARACTERISTIC:
                return(CharacteristicExpression.Deserialize(ms, vec));

            case EExpressionType.MANUFACTORINGDATE:
                return(ManufactoringDateExpression.Deserialize(ms, vec));

            case EExpressionType.ISTUFEX:
                return(IStufeXExpression.Deserialize(ms, vec));
            }
            throw new Exception("Unknown Expression-Type");
        }