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; }
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; }
/// <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; }
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"); }
private void Update() { int count = FromText.ToInt(); if (count > 0) { Global.Instance.MaxPassLevel = count; } }
private void ConvertNumbers() { try { int fromNumber = 0; switch (FromConverterName) { case "Numerical": fromNumber = Int32.Parse(FromText); break; case "Binary": fromNumber = Convert.ToInt32(FromText, 2); break; case "Hexadecimal": fromNumber = Convert.ToInt32(FromText, 16); break; case "Roman": fromNumber = ConvertRomanToNumber(FromText.ToUpper()); break; default: break; } switch (ToConverterName) { case "Numerical": ToText = fromNumber.ToString(); break; case "Binary": ToText = Convert.ToString(fromNumber, 2); break; case "Hexadecimal": ToText = Convert.ToString(fromNumber, 16); break; case "Roman": ToText = ToRoman(fromNumber); break; default: break; } } catch (FormatException ex) { ToText = "Error"; } }
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; }