Inheritance: DataDictionary.Types.Type
コード例 #1
0
 public virtual void visit(Range obj, bool visitSubNodes)
 {
     visit ((Type) obj, false);
     if (visitSubNodes){
     IXmlBBase[] Subs  = acceptor.subElements((IXmlBBase)obj);
     if (Subs != null){
     for (int i=0; i<Subs.Length; i++) {
       dispatch(Subs[i], true);
     } // If
     } // If
     }
 }
コード例 #2
0
        public override void visit(Range obj, bool visitSubNodes)
        {
            obj.setPrecision(acceptor.PrecisionEnum.aIntegerPrecision);

            base.visit(obj, visitSubNodes);
        }
コード例 #3
0
 public virtual void visit(Range obj)
 {
     visit(obj, true);
 }
コード例 #4
0
 public void copyTo(Range other)
 {
     base.copyTo(other);
     other.aMinValue = aMinValue;
     other.aMaxValue = aMaxValue;
     other.aSpecialValues = aSpecialValues;
     other.aPrecision = aPrecision;
 }
コード例 #5
0
 public void insertRanges(int idx, Range el,Lock aLock)
 {
     __setDirty(true);
       allRanges().Insert (idx, el);
     NotifyControllers(aLock);
 }
コード例 #6
0
 public void appendRanges(Lock aLock,Range el)
 {
     __setDirty(true);
       el.__setDirty(true);
       allRanges().Add(el);
       acceptor.connectSon (this, el);
     NotifyControllers(aLock);
 }
コード例 #7
0
        public override void visit(Range obj, bool visitSubNodes)
        {
            Types.Range range = (Types.Range) obj;

            if (range.getPrecision() == acceptor.PrecisionEnum.aIntegerPrecision)
            {
                if (range.getMinValue().IndexOf(".") >= 0)
                {
                    range.AddError("Invalid min value for integer range : must be an integer");
                }

                if (range.getMaxValue().IndexOf(".") >= 0)
                {
                    range.AddError("Invalid max value for integer range : must be an integer");
                }
            }
            else
            {
                if (range.getMinValue().IndexOf(".") < 0)
                {
                    range.AddError("Invalid min value for float range : must have a decimal part");
                }

                if (range.getMaxValue().IndexOf(".") < 0)
                {
                    range.AddError("Invalid max value for float range : must have a decimal part");
                }
            }
            try
            {
                Decimal min = range.MinValueAsLong;
            }
            catch (FormatException)
            {
                range.AddError("Cannot parse min value for range");
            }

            try
            {
                Decimal max = range.MaxValueAsLong;
            }
            catch (FormatException)
            {
                range.AddError("Cannot parse max value for range");
            }

            List<Constants.EnumValue> valuesFound = new List<Constants.EnumValue>();
            foreach (Constants.EnumValue enumValue in range.SpecialValues)
            {
                if (enumValue.Value == null)
                {
                    enumValue.AddError("Value is not valid");
                }
                else
                {
                    foreach (Constants.EnumValue other in valuesFound)
                    {
                        if (range.CompareForEquality(enumValue.Value, other.Value))
                        {
                            enumValue.AddError("Duplicate special value");
                            other.AddError("Duplicate special value");
                        }

                        if (enumValue.LiteralName == other.LiteralName)
                        {
                            enumValue.AddError("Duplicate special value name");
                            other.AddError("Duplicate special value name");
                        }
                    }
                    valuesFound.Add(enumValue);
                }
            }

            base.visit(obj, visitSubNodes);
        }