コード例 #1
0
ファイル: spinner.cs プロジェクト: modulexcite/IL2JS
        // TODO(jkern): integrate this with new SpinnerProperties etc.
        public Spinner(Root root, string id, SpinnerProperties properties, Unit[] validUnits)
            : base(root, id, properties)
        {
            AddDisplayMode("Medium");

            _accIterations = 0;
            _multiplier = 1;
            _validUnits = validUnits;
            _value = Double.Parse(Properties.DefaultValue);
            StateProperties[SpinnerCommandProperties.Value] = _value.ToString();
            _currentUnit = FindUnitByNameOrAbbreviation(Properties.DefaultUnit);

            if (CUIUtility.IsNullOrUndefined(_currentUnit))
                throw new ArgumentOutOfRangeException("The default unit is not in the list of valid units");
            StateProperties[SpinnerCommandProperties.Unit] = _currentUnit.Name;
        }
コード例 #2
0
ファイル: spinner.cs プロジェクト: tralivali1234/IL2JS
        // TODO(jkern): integrate this with new SpinnerProperties etc.
        public Spinner(Root root, string id, SpinnerProperties properties, Unit[] validUnits)
            : base(root, id, properties)
        {
            AddDisplayMode("Medium");

            _accIterations = 0;
            _multiplier    = 1;
            _validUnits    = validUnits;
            _value         = Double.Parse(Properties.DefaultValue);
            StateProperties[SpinnerCommandProperties.Value] = _value.ToString();
            _currentUnit = FindUnitByNameOrAbbreviation(Properties.DefaultUnit);

            if (CUIUtility.IsNullOrUndefined(_currentUnit))
            {
                throw new ArgumentOutOfRangeException("The default unit is not in the list of valid units");
            }
            StateProperties[SpinnerCommandProperties.Unit] = _currentUnit.Name;
        }