示例#1
0
        protected DoubleUpDown(FromText fromText, FromDecimal fromDecimal, Func <double, double, bool> fromLowerThan,
                               Func <double, double, bool> fromGreaterThan)
        {
            if (fromText == null)
            {
                throw new ArgumentNullException("parseMethod");
            }

            if (fromDecimal == null)
            {
                throw new ArgumentNullException("fromDecimal");
            }

            if (fromLowerThan == null)
            {
                throw new ArgumentNullException("fromLowerThan");
            }

            if (fromGreaterThan == null)
            {
                throw new ArgumentNullException("fromGreaterThan");
            }

            _fromText        = fromText;
            _fromDecimal     = fromDecimal;
            _fromLowerThan   = fromLowerThan;
            _fromGreaterThan = fromGreaterThan;
        }
        protected CommonNumericUpDown(FromText fromText, FromDecimal fromDecimal, Func <T, T, bool> fromLowerThan,
                                      Func <T, T, bool> fromGreaterThan)
        {
            if (fromText is null)
            {
                throw new ArgumentNullException("parseMethod");
            }

            if (fromDecimal is null)
            {
                throw new ArgumentNullException("fromDecimal");
            }

            if (fromLowerThan is null)
            {
                throw new ArgumentNullException("fromLowerThan");
            }

            if (fromGreaterThan is null)
            {
                throw new ArgumentNullException("fromGreaterThan");
            }

            _fromText        = fromText;
            _fromDecimal     = fromDecimal;
            _fromLowerThan   = fromLowerThan;
            _fromGreaterThan = fromGreaterThan;
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ANativeNumericUpDown"/> class.
        /// </summary>
        /// <param name="pFromText">The value converter from text.</param>
        /// <param name="pFromDecimal">The value converter from decimal.</param>
        /// <param name="pFromLowerThan">The lower than comparator.</param>
        /// <param name="pFromGreaterThan">The greater than comparator.</param>
        protected ANativeNumericUpDown(FromText pFromText, FromDecimal pFromDecimal, Func <T, T, bool> pFromLowerThan, Func <T, T, bool> pFromGreaterThan)
        {
            if (pFromText == null)
            {
                throw new ArgumentNullException("parseMethod");
            }

            if (pFromDecimal == null)
            {
                throw new ArgumentNullException("fromDecimal");
            }

            if (pFromLowerThan == null)
            {
                throw new ArgumentNullException("fromLowerThan");
            }

            if (pFromGreaterThan == null)
            {
                throw new ArgumentNullException("fromGreaterThan");
            }

            this.mFromText        = pFromText;
            this.mFromDecimal     = pFromDecimal;
            this.mFromLowerThan   = pFromLowerThan;
            this.mFromGreaterThan = pFromGreaterThan;
        }
示例#4
0
 protected DoubleUpDown(FromText fromText, FromDecimal fromDecimal, Func <double, double, bool> fromLowerThan, Func <double, double, bool> fromGreaterThan)
 {
     _fromText        = fromText ?? throw new ArgumentNullException("parseMethod");
     _fromDecimal     = fromDecimal ?? throw new ArgumentNullException("fromDecimal");
     _fromLowerThan   = fromLowerThan ?? throw new ArgumentNullException("fromLowerThan");
     _fromGreaterThan = fromGreaterThan ?? throw new ArgumentNullException("fromGreaterThan");
 }
示例#5
0
    public void TestMethod()
    {
        decimal a     = 1.1m;
        var     Inter = new FromDecimal <int>();
        int     x     = Inter.GetFromDecimal(a);
        int?    y     = Inter.GetFromDecimal(a);

        Console.WriteLine("{0} {1}", x, y);
        var    Doubler = new FromDecimal <double>();
        double dx      = Doubler.GetFromDecimal(a);
        double?dy      = Doubler.GetFromDecimal(a);

        Console.WriteLine("{0} {1}", dx, dy);
    }
示例#6
0
        protected DoubleUpDown(FromText fromText, FromDecimal fromDecimal, Func<double, double, bool> fromLowerThan, Func<double, double, bool> fromGreaterThan)
        {
            if (fromText == null)
                throw new ArgumentNullException("parseMethod");

            if (fromDecimal == null)
                throw new ArgumentNullException("fromDecimal");

            if (fromLowerThan == null)
                throw new ArgumentNullException("fromLowerThan");

            if (fromGreaterThan == null)
                throw new ArgumentNullException("fromGreaterThan");

            _fromText = fromText;
            _fromDecimal = fromDecimal;
            _fromLowerThan = fromLowerThan;
            _fromGreaterThan = fromGreaterThan;
        }