本文整理汇总了C#中System.Collections.Specialized.NotifyCollectionChangedEventArgs.get_NewStartingIndex方法的典型用法代码示例。如果您正苦于以下问题:C# NotifyCollectionChangedEventArgs.get_NewStartingIndex方法的具体用法?C# NotifyCollectionChangedEventArgs.get_NewStartingIndex怎么用?C# NotifyCollectionChangedEventArgs.get_NewStartingIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Specialized.NotifyCollectionChangedEventArgs
的用法示例。
在下文中一共展示了NotifyCollectionChangedEventArgs.get_NewStartingIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessCollectionChanged
private void ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
{
if (this.CheckFlag(CollectionViewFlags.ShouldProcessCollectionChanged))
{
if (args.get_Action() == 4)
{
if (!this.SourceCollection.GetEnumerator().MoveNext())
{
this._internalList.Clear();
}
this.RefreshOrDefer();
}
else
{
object item = (args.get_NewItems() != null) ? args.get_NewItems()[0] : null;
object removedItem = (args.get_OldItems() != null) ? args.get_OldItems()[0] : null;
if ((args.get_Action() == 1) || (args.get_Action() == 2))
{
this.ProcessRemoveEvent(removedItem, args.get_Action() == 2);
}
if (((args.get_Action() == null) || (args.get_Action() == 2)) && ((this.Filter == null) || this.PassesFilter(item)))
{
this.ProcessAddEvent(item, args.get_NewStartingIndex());
}
if (args.get_Action() != 2)
{
this.OnPropertyChanged("ItemCount");
}
}
}
}
示例2: OnCollectionChanged
private void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
{
if (args == null)
{
throw new ArgumentNullException("args");
}
this._timestamp++;
if ((this.CollectionChanged != null) && (((args.get_Action() != null) || (this.PageSize == 0)) || (args.get_NewStartingIndex() < this.Count)))
{
this.CollectionChanged.Invoke(this, args);
}
if (args.get_Action() != 2)
{
this.OnPropertyChanged("Count");
}
bool isEmpty = this.IsEmpty;
if (isEmpty != this.CheckFlag(CollectionViewFlags.CachedIsEmpty))
{
this.SetFlag(CollectionViewFlags.CachedIsEmpty, isEmpty);
this.OnPropertyChanged("IsEmpty");
}
}