Exemple #1
0
        public void RemoveValue(DreamValue value)
        {
            int valueIndex = _values.LastIndexOf(value);

            if (valueIndex != -1)
            {
                BeforeValueRemoved?.Invoke(this, new DreamValue(valueIndex), _values[valueIndex]);

                _values.RemoveAt(valueIndex);
            }
        }
Exemple #2
0
        public void Cut(int start = 1, int end = 0)
        {
            if (end == 0 || end > (_values.Count + 1))
            {
                end = _values.Count + 1;
            }

            if (BeforeValueRemoved != null)
            {
                for (int i = end - 1; i >= start; i--)
                {
                    BeforeValueRemoved.Invoke(this, new DreamValue(i), _values[i - 1]);
                }
            }

            _values.RemoveRange(start - 1, end - start);
        }