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); }
/// <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); }
/// <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; }