W
wy6688
though C# have a indexers as class default index
property. in a class you can write
public class TestA
{
private byte[] A;
public byte this[int index]
{
get{ return A[index]}
set{ A[index]=value}
}
}.
but I think the indexers should be generalized to property
indexers. for example
public class TestB
{
private byte[] a;
private int [] b;
public byte A[int index]
{
get {return a[index])
set {a[index]=value)}
}
public byte B[int index]
{
get {return b[index])
set {b[index]=value)
}
}
property. in a class you can write
public class TestA
{
private byte[] A;
public byte this[int index]
{
get{ return A[index]}
set{ A[index]=value}
}
}.
but I think the indexers should be generalized to property
indexers. for example
public class TestB
{
private byte[] a;
private int [] b;
public byte A[int index]
{
get {return a[index])
set {a[index]=value)}
}
public byte B[int index]
{
get {return b[index])
set {b[index]=value)
}
}