Ejemplo n.º 1
0
 /// <summary>
 /// Raises <see cref="CollectionModified" /> and <see cref="RangeAdded" /> events
 /// </summary>
 /// <param name="e">An <see cref="EasyTabs.EventList.ListRangeEventArgs" /> that contains the event data</param>
 protected virtual void OnRangeAdded(ListRangeEventArgs e)
 {
     if (IgnoreEvents)
     {
         return;
     }
     RangeAdded?.Invoke(this, e);
     OnCollectionModified(new ListModificationEventArgs(ListModification.RangeAdded, e.StartIndex, e.Count));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a range to the collection of ranges this rule applies to.
        /// If the specified range does not belong to the worksheet of the data validation
        /// rule it is transferred to the target worksheet.
        /// </summary>
        /// <param name="range">A range to add.</param>
        public void AddRange(IXLRange range)
        {
            if (range == null)
            {
                throw new ArgumentNullException(nameof(range));
            }

            if (range.Worksheet != Worksheet)
            {
                range = Worksheet.Range(((XLRangeAddress)range.RangeAddress).WithoutWorksheet());
            }

            _ranges.Add(range);

            RangeAdded?.Invoke(this, new RangeEventArgs(range));
        }