Evgenij Tsvetkov
Member
Hi.
The AddInternal method checks the m_AddingToCollection field for zero and calls RejectItem. I can create an action to throw an item when the RejectItem fires.
But I want to know in advance if there is a place?
The CanAddItem method tries to add item and if there is no m_AddingToCollection = null;
Perhaps there is a way to find out m_AddingToCollection?
Now I have done this ExtendedItemTransactionCollection:
And I have an action that checks if it can add.
This decision is normal, or there are other options?
The AddInternal method checks the m_AddingToCollection field for zero and calls RejectItem. I can create an action to throw an item when the RejectItem fires.
But I want to know in advance if there is a place?
The CanAddItem method tries to add item and if there is no m_AddingToCollection = null;
Perhaps there is a way to find out m_AddingToCollection?
Now I have done this ExtendedItemTransactionCollection:
C#:
protected ItemCollection m_AddingToCollection;
public ItemCollection AddingToCollection => m_AddingToCollection;
And I have an action that checks if it can add.
C#:
protected override bool CanInvokeInternal(ItemInfo itemInfo, ItemUser itemUser)
{
//....
var addedItemInfo = itemCollection.CanAddItem(itemInfo);
if (addedItemInfo.HasValue == false)
return false;
return itemCollection.AddingToCollection != null;
}
This decision is normal, or there are other options?
Last edited: