Example #1
0
        private void Initialize(IRenderInfoState loadState, int capacity, long defaultValue)
        {
            if (defaultValue != 0)
            {
                var currentValue = defaultValue;

                this.initializeStorageInProgress = true;

                for (int i = 0; capacity > 0; i++)
                {
                    if (loadState != null)
                    {
                        var loadValue = loadState.GetValueAt(i);

                        currentValue = loadValue.HasValue ? IndexStorage.DoubleToLong(loadValue.Value, IndexStorage.PrecisionMultiplier) : defaultValue;
                    }

                    this[i] = currentValue;
                    capacity--;
                }

                this.initializeStorageInProgress = false;

                this.RefreshAggregateInfo();
            }
        }
Example #2
0
        public void ResetToDefaultValues(IRenderInfoState loadState, double defaultValue)
        {
            this.Clear();

            long itemLength = double.IsNaN(defaultValue) ? this.itemDefaultValue : IndexStorage.DoubleToLong(defaultValue, IndexStorage.PrecisionMultiplier);

            this.Initialize(loadState, this.Count, itemLength);
        }