Delegate ResourceMirror.CreateResource<ItemType, ResourceType>
Callback for creating a new instance of a resource matching a specific item. This will be called for each item in Sync's currentItems list which doesn't have a matching resource in Sync's resources list.
public delegate bool CreateResource<ItemType, ResourceType>(ItemType item, out ResourceType resource);
The source item to create a new resource for.
out param for created resource.
Returns true if a resource was created successfully.
Type of the source data.
Type of the resources to be managed.
Note that it is not an error to return false, it only means that for any reason the resource was not created. However, if the resource is not created, then in the next call to Sync, it will be noted that the item doesn't have a matching resource and the create call will be made again. To prevent fruitless and possibly expensive create calls, the offending item should be removed from the items list passed into Sync. As noted below, all additions and removals from the items list must happen outside the Sync call.