本文整理汇总了C#中NotifyCollectionChangedAction类的典型用法代码示例。如果您正苦于以下问题:C# NotifyCollectionChangedAction类的具体用法?C# NotifyCollectionChangedAction怎么用?C# NotifyCollectionChangedAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotifyCollectionChangedAction类属于命名空间,在下文中一共展示了NotifyCollectionChangedAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NotifyCollectionChangedEventArgs
/// <summary>
/// Construct a NotifyCollectionChangedEventArgs that describes a one-item change.
/// </summary>
/// <param name="action">The action that caused the event.</param>
/// <param name="changedItem">The item affected by the change.</param>
/// <param name="index">The index where the change occurred.</param>
public NotifyCollectionChangedEventArgs(
NotifyCollectionChangedAction action,
object changedItem,
int index)
: this(action, changedItem == null? null: new[]{ changedItem }, index)
{
}
示例2: ControllerCollectionChangedEventArgs
public ControllerCollectionChangedEventArgs(Entity entity, AudioEmitterSoundController controller, AudioEmitterComponent component, NotifyCollectionChangedAction action)
{
Entity = entity;
Controller = controller;
EmitterComponent = component;
Action = action;
}
示例3: NotifyCollectionChangedEventArgs
/// <summary>
/// Construct a NotifyCollectionChangedEventArgs that describes a reset change.
/// </summary>
/// <param name="action">The action that caused the event (must be Reset).
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action)
{
if (action != NotifyCollectionChangedAction.Reset)
throw new ArgumentException("WrongActionForCtor, NotifyCollectionChangedAction.Reset", "action");
InitializeAdd(action, null, -1);
}
示例4: NotifyCollectionChangedEventArgs
//------------------------------------------------------
//
// Constructors
//
//------------------------------------------------------
/// <summary>
/// Construct a NotifyCollectionChangedEventArgs that describes a reset change.
/// </summary>
/// <param name="action">The action that caused the event (must be Reset).</param>
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action)
{
if (action != NotifyCollectionChangedAction.Reset)
throw new ArgumentException("This constructor can only be used with the Reset action.", "action");
InitializeAdd(action, null, -1);
}
示例5: NotifyCollectionChangedEventArgs
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList changedItems, int index, int oldIndex)
{
this.Action = action;
this.NewItems = changedItems;
this.NewStartingIndex = index;
this.OldStartingIndex = oldIndex;
}
示例6: NotifyCollectionChangedEventArgs
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList changedItems)
{
this._newStartingIndex = -1;
this._oldStartingIndex = -1;
if (((action != NotifyCollectionChangedAction.Add) && (action != NotifyCollectionChangedAction.Remove)) && (action != NotifyCollectionChangedAction.Reset))
{
throw new ArgumentException("Must Be Reset Add Or Remove Action For Ctor", "action");
}
if (action == NotifyCollectionChangedAction.Reset)
{
if (changedItems != null)
{
throw new ArgumentException("Reset Action Requires Null Item", "action");
}
this.InitializeAdd(action, null, -1);
}
else
{
if (changedItems == null)
{
throw new ArgumentNullException("changed Items");
}
this.InitializeAddOrRemove(action, changedItems, -1);
}
}
示例7: CollectionChangedActionItem
public CollectionChangedActionItem(IList list, NotifyCollectionChangedAction actionToUndo, IReadOnlyCollection<object> items, int index)
: this(list, actionToUndo)
{
if (items == null) throw new ArgumentNullException("items");
this.items = items;
this.index = index;
}
示例8: NotifyCollectionChangedEventArgs
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList changedItems, int startingIndex)
{
this.action = action;
if (action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove) {
if (changedItems == null)
throw new ArgumentNullException ("changedItems");
if (startingIndex < -1)
throw new ArgumentException ("The value of startingIndex must be -1 or greater.", "startingIndex");
if (action == NotifyCollectionChangedAction.Add)
InitializeAdd (changedItems, startingIndex);
else
InitializeRemove (changedItems, startingIndex);
} else if (action == NotifyCollectionChangedAction.Reset) {
if (changedItems != null)
throw new ArgumentException ("This constructor can only be used with the Reset action if changedItems is null", "changedItems");
if (startingIndex != -1)
throw new ArgumentException ("This constructor can only be used with the Reset action if startingIndex is -1", "startingIndex");
} else {
throw new ArgumentException ("This constructor can only be used with the Reset, Add, or Remove actions.", "action");
}
}
示例9: ItemsChangedEventArgs
internal ItemsChangedEventArgs(NotifyCollectionChangedAction action,
GeneratorPosition position,
int itemCount,
int itemUICount) : this(action, position, new GeneratorPosition(-1, 0), itemCount, itemUICount)
{
}
示例10: NotifyCollectionChangedEventArgs
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, object changedItem, int index)
{
IList changedItems = new[] { changedItem };
_action = action;
if (action == NotifyCollectionChangedAction.Add)
{
InitializeAdd(changedItems, index);
}
else if (action == NotifyCollectionChangedAction.Remove)
{
InitializeRemove(changedItems, index);
}
else if (action == NotifyCollectionChangedAction.Reset)
{
if (changedItem != null)
{
throw new ArgumentException("This constructor can only be used with the Reset action if changedItem is null", "changedItem");
}
if (index != -1)
{
throw new ArgumentException("This constructor can only be used with the Reset action if index is -1", "index");
}
}
else
{
throw new ArgumentException("This constructor can only be used with the Reset, Add, or Remove actions.", "action");
}
}
示例11: CollectionChangeOperation
public CollectionChangeOperation(IList list, NotifyCollectionChangedAction actionToUndo, IReadOnlyCollection<object> items, int index, IEnumerable<IDirtiable> dirtiables)
: this(list, actionToUndo, dirtiables)
{
if (items == null) throw new ArgumentNullException(nameof(items));
this.items = items;
this.index = index;
}
示例12: DictionaryChangedEventArgs
internal DictionaryChangedEventArgs(NotifyCollectionChangedAction action, string key, object oldValue, object newValue)
{
this.Action = action;
this.Key = key;
this.OldValue = oldValue;
this.NewValue = newValue;
}
示例13: NotifyCollectionChangedEventArgs
//------------------------------------------------------
//
// Constructors
//
//------------------------------------------------------
/// <summary>
/// Construct a NotifyCollectionChangedEventArgs that describes a reset change.
/// </summary>
/// <param name="action">The action that caused the event (must be Reset).</param>
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action)
{
if (action != NotifyCollectionChangedAction.Reset)
throw new ArgumentException(SR.Format(SR.WrongActionForCtor, NotifyCollectionChangedAction.Reset), nameof(action));
InitializeAdd(action, null, -1);
}
示例14: NotifyCollectionChangedEventArgs
private NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IEnumerable<object> oldItems, int oldStartingIndex, IEnumerable<object> newItems, int newStartingIndex)
{
this.Action = action;
this.OldItems = oldItems;
this.OldStartingIndex = oldStartingIndex;
this.NewItems = newItems;
this.NewStartingIndex = newStartingIndex;
}
示例15: NotifyCollectionChangedEventArgs
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, int newStartingIndex, int oldStartingIndex, IList newItems, IList oldItems)
{
Action = action;
NewStartingIndex = newStartingIndex;
OldStartingIndex = oldStartingIndex;
NewItems = newItems;
OldItems = oldItems;
}