Source/Editors/VisualIntegerInput.cs

(开头部分) 11KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

#if FRAMEWORK20
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Globalization;
using System.Windows.Forms;

namespace DevComponents.Editors
{
    public class VisualIntegerInput : VisualNumericInput
    {
        #region Private Variables
        private int _Value = 0;
        private int _MinValue = int.MinValue;
        private int _MaxValue = int.MaxValue;
        #endregion

        #region Events
        #endregion

        #region Constructor
        #endregion

        #region Internal Implementation
        protected override void OnInputStackChanged()
        {
            if (this.InputStack.Length > 0)
            {
                this.IsEmpty = false;

                if (this.InputStack == "-")
                {
                    SetValue(0, true);
                    return;
                }

                int newValue = int.Parse(this.InputStack);
                SetValue(newValue, true);
            }
            else
            {
                if (this.AllowEmptyState)
                    this.IsEmpty = true;
                SetValue(0, true);
            }

            base.OnInputStackChanged();
        }

        protected override void OnInputKeyAccepted()
        {
            CheckInputComplete(true);
            base.OnInputKeyAccepted();
        }

        private void CheckInputComplete(bool sendNotification)
        {
            int predictedValue = GetNextPredictedValue(_Value);

后面还有 310 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。