Skip to content

M_CodeJam_Collections_OwnedCollection_Create__3

Andrew Koryavchenko edited this page Jun 17, 2018 · 2 revisions

OwnedCollection.Create(TOwner, TKey, TItem) Method (TOwner, Func(TItem, TOwner), Action(TItem, TOwner), Func(TItem, TKey))

Creates a new instance of the OwnedCollection(TOwner, TKey, TItem) class.

Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public static OwnedCollection<TOwner, TKey, TItem> Create<TOwner, TKey, TItem>(
	TOwner owner,
	Func<TItem, TOwner> ownerGetter,
	Action<TItem, TOwner> ownerSetter,
	Func<TItem, TKey> keyGetter
)
where TOwner : class
where TItem : class

VB

Public Shared Function Create(Of TOwner As Class, TKey, TItem As Class) ( 
	owner As TOwner,
	ownerGetter As Func(Of TItem, TOwner),
	ownerSetter As Action(Of TItem, TOwner),
	keyGetter As Func(Of TItem, TKey)
) As OwnedCollection(Of TOwner, TKey, TItem)

F#

static member Create : 
        owner : 'TOwner * 
        ownerGetter : Func<'TItem, 'TOwner> * 
        ownerSetter : Action<'TItem, 'TOwner> * 
        keyGetter : Func<'TItem, 'TKey> -> OwnedCollection<'TOwner, 'TKey, 'TItem>  when 'TOwner : not struct when 'TItem : not struct

Parameters

 

owner
Type: TOwner
The owner for the collection.
ownerGetter
Type: System.Func(TItem, TOwner)
Owner getter for the item.
ownerSetter
Type: System.Action(TItem, TOwner)
Owner setter for the item.
keyGetter
Type: System.Func(TItem, TKey)
Key getter for the item.

Type Parameters

 

TOwner
The type of the owner.
TKey
The type of the key.
TItem
The type of the item.

Return Value

Type: OwnedCollection(TOwner, TKey, TItem)
A new instance of the OwnedCollection(TOwner, TKey, TItem) class.

See Also

Reference

OwnedCollection Class
Create Overload
CodeJam.Collections Namespace

Clone this wiki locally