G
Guy
I am writing an interface that will be implemented on
collection type objects.
The interface was previously written in vb.net for an
application and was coded as follows
Public Interface IListEditorCollection
Function ToString() As String
Function Add() As IListEditorItem
Default ReadOnly Property Item(ByVal Index As Int32)
As IListEditorItem
ReadOnly Property ItemByPK(ByVal ID As Int32) As
IListEditorItem
ReadOnly Property Count() As Int32
End Interface
As you can see the interface defines two properties that
take parameters.
I am aware that C# provides this functionality by using
the 'this' keyword to provide an indexer and you can have
many different indexers by using the Runtime.IndexerName
attribute on each different property declaration.
What i am stuck with is how do i define these in C# for my
interface?
collection type objects.
The interface was previously written in vb.net for an
application and was coded as follows
Public Interface IListEditorCollection
Function ToString() As String
Function Add() As IListEditorItem
Default ReadOnly Property Item(ByVal Index As Int32)
As IListEditorItem
ReadOnly Property ItemByPK(ByVal ID As Int32) As
IListEditorItem
ReadOnly Property Count() As Int32
End Interface
As you can see the interface defines two properties that
take parameters.
I am aware that C# provides this functionality by using
the 'this' keyword to provide an indexer and you can have
many different indexers by using the Runtime.IndexerName
attribute on each different property declaration.
What i am stuck with is how do i define these in C# for my
interface?