Exemplo n.º 1
0
        public Border GetBorderReadOnly(BorderType type)
        {
            switch (type)
            {
            case BorderType.Bottom:
                return(_bottom);

            case BorderType.DiagonalDown:
                return(_diagonalDown);

            case BorderType.DiagonalUp:
                return(_diagonalUp);

            case BorderType.Horizontal:
            case BorderType.Vertical:
                return((Border)GetValue(type.ToString(), GV.GetNull));

            case BorderType.Left:
                return(_left);

            case BorderType.Right:
                return(_right);

            case BorderType.Top:
                return(_top);
            }
            if (!Enum.IsDefined(typeof(BorderType), type))
            {
                throw new /*InvalidEnum*/ ArgumentException(DomSR.InvalidEnumValue(type), "type");
            }
            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Determines whether a particular border exists.
        /// </summary>
        public bool HasBorder(BorderType type)
        {
            if (!Enum.IsDefined(typeof(BorderType), type))
            {
                throw new /*InvalidEnum*/ ArgumentException(DomSR.InvalidEnumValue(type), "type");
            }

            return(GetBorderReadOnly(type) != null);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the Unit class.
        /// Throws System.ArgumentException if <code>type</code> is invalid.
        /// </summary>
        public Unit(double value, UnitType type)
        {
            if (!Enum.IsDefined(typeof(UnitType), type))
            {
                throw new /*InvalidEnum*/ ArgumentException(DomSR.InvalidEnumValue(type), "type");
            }

            _value       = (float)value;
            _type        = type;
            _initialized = true;
        }