Beispiel #1
0
        private void SetType(ExpressionMultiplierType value)
        {
            m_Type = value;
            switch (value)
            {
            case ExpressionMultiplierType.ZeroOrMore:
                min = 0;
                max = Infinity;
                break;

            case ExpressionMultiplierType.ZeroOrOne:
                min = 0;
                max = 1;
                break;

            case ExpressionMultiplierType.OneOrMore:
            case ExpressionMultiplierType.OneOrMoreComma:
            case ExpressionMultiplierType.GroupAtLeastOne:
                min = 1;
                max = Infinity;
                break;

            default:
                min = max = 1;
                break;
            }
        }
Beispiel #2
0
        private void SetType(ExpressionMultiplierType value)
        {
            this.m_Type = value;
            switch (value)
            {
            case ExpressionMultiplierType.ZeroOrMore:
                this.min = 0;
                this.max = 10;
                return;

            case ExpressionMultiplierType.OneOrMore:
            case ExpressionMultiplierType.OneOrMoreComma:
            case ExpressionMultiplierType.GroupAtLeastOne:
                this.min = 1;
                this.max = 10;
                return;

            case ExpressionMultiplierType.ZeroOrOne:
                this.min = 0;
                this.max = 1;
                return;
            }
            this.min = (this.max = 1);
        }
Beispiel #3
0
 public ExpressionMultiplier(ExpressionMultiplierType type = ExpressionMultiplierType.None)
 {
     this.m_Type = type;
     this.min    = (this.max = 1);
     this.SetType(type);
 }
Beispiel #4
0
 public ExpressionMultiplier(ExpressionMultiplierType type = ExpressionMultiplierType.None)
 {
     m_Type = type;
     min = max = 1;
     SetType(type);
 }