コード例 #1
0
        internal void Prepare()
        {
            ClientSideEvents.KeyDown = "OnSpinEditKeyDown";
            switch (NumberFormatType)
            {
            case NumberFormatType.Number:
                Subfix            = Prefix = string.Empty;
                _currencySettting = new CurrencyProperty(this);
                break;

            case NumberFormatType.NumberWithCurrency:
                _displayFormatString = _currencySettting.DisplayFormat;
                Prefix = string.Empty;
                Subfix = " " + _currencySettting.CcyAsc3;
                break;

            case NumberFormatType.CustomFormat:
                _currencySettting = new CurrencyProperty(this);
                break;

            case NumberFormatType.Prefix:
                Subfix            = string.Empty;
                _currencySettting = new CurrencyProperty(this);
                break;

            case NumberFormatType.Subfix:
                Prefix            = string.Empty;
                _currencySettting = new CurrencyProperty(this);
                break;

            case NumberFormatType.PrefixAndSubFix:
                _currencySettting = new CurrencyProperty(this);
                InitFormatString(Prefix, Subfix);
                break;

            case NumberFormatType.Percentage:
                _currencySettting = new CurrencyProperty(this);
                Prefix            = string.Empty;
                Subfix            = " %";
                break;

            default:
                Prefix            = Subfix = string.Empty;
                _currencySettting = new CurrencyProperty(this);
                break;
            }
            _displayFormatString = InitFormatString(Prefix, Subfix);
            //this.ClientSideEvents.Init = "function(s,e){ console.log(s.GetRawValue());s.MaxTotalDigit =" + (MaxTotalNumber.HasValue ? MaxTotalNumber.Value.ToString() : "null") + "; "
            //                                                + "s.MaxDigitAfterDecimalPoint = " + (MaxNumberAfterDecimalPoint.HasValue ? MaxNumberAfterDecimalPoint.Value.ToString() : "null") + "; "
            //                                                + $"s.ThousandPoint = '{Currency.ThousandPoint}'; "
            //                                                + $"s.DecimalPoint = '{Currency.DecimalPoint}'; "
            //                                                + $"s.Prefix = '{Prefix}'; "
            //                                                + $"s.Subfix = '{Subfix}'; "
            //                                                + "s.IsCustomControl = true; "
            //                                                + "s.NumberType = '" + (NumberType == NumberType.Float ? "f" : "i") + "'; "
            //                                                + "InitTextBox(s);s.SetRawValue('" + SimpleValue + "');s.SetValue('" + SimpleValue + "')}";
            this.ClientSideEvents.Init = $"function(s,e,){{ InitSpinEdit(s,e, {(MaxTotalNumber.HasValue ? MaxTotalNumber.Value.ToString() : "null")}," +
                                         $"{(MaxNumberAfterDecimalPoint.HasValue ? MaxNumberAfterDecimalPoint.Value.ToString() : "null")}," +
                                         $"'{Currency.ThousandPoint}','{Currency.DecimalPoint}','{Prefix}','{Subfix}')}}";
        }
コード例 #2
0
 public LOSMVCxSpinEditProperties()
 {
     _currencySettting            = new CurrencyProperty(this);
     this.DisplayFormatInEditMode = true;
     this.Styles.Style.CssClass   = "warning-control";
 }