Beispiel #1
0
        public static string ToString(this IntervalValueType type, IntervalNotationPosition position)
        {
            switch (position)
            {
            case IntervalNotationPosition.Left:
                switch (type)
                {
                case IntervalValueType.Inclusive: return("[");

                case IntervalValueType.Exclusive: return("(");

                default:
                    throw new NotSupportedException();
                }

            case IntervalNotationPosition.Right:
                switch (type)
                {
                case IntervalValueType.Inclusive: return("]");

                case IntervalValueType.Exclusive: return(")");

                default:
                    throw new NotSupportedException();
                }

            default:
                throw new NotSupportedException();
            }
        }
Beispiel #2
0
        internal string ToString(IntervalNotationPosition position)
        {
            var notation = this.Type.ToString(position);

            switch (position)
            {
            case IntervalNotationPosition.Left:
                return($"{notation}{this.Value}");

            case IntervalNotationPosition.Right:
                return($"{this.Value}{notation}");

            default:
                throw new NotSupportedException();
            }
        }
    internal string ToString(IntervalNotationPosition position)
    {
        var notation = this.Type.ToString(position);

        switch (position)
        {
        case IntervalNotationPosition.Left:
            return(string.Format("{0}{1}", notation, this.Value));

        case IntervalNotationPosition.Right:
            return(string.Format("{0}{1}", this.Value, notation));

        default:
            throw new NotSupportedException();
        }
    }