I have several Delphi Prism classes with indexed properties that I use a lot on my C # web applications (we are porting a large Delphi Win32 system to ASP.Net). My problem is that C # seems to not see indexed properties unless they are the default properties for their classes. Maybe I'm doing something wrong, but I'm completely lost.
I know this question is very similar to an error report, but I need to know if anyone knows how to solve this before reporting an error.
If I have a class like this:
TMyClass = public class
private
...
method get_IndexedBool(index: Integer): boolean;
method set_IndexedBool(index: Integer; value: boolean);
public
property IndexedBool[index: Integer]: boolean
read get_IndexedBool
write set_IndexedBool; default;
end;
I can use this class in C # as follows:
var myObj = new TMyClass();
myObj[0] = true;
However, if TMyClass is defined as follows:
TMyClass = public class
private
...
method get_IndexedBool(index: Integer): boolean;
method set_IndexedBool(index: Integer; value: boolean);
public
property IndexedBool[index: Integer]: boolean
read get_IndexedBool
write set_IndexedBool;
end;
IndexedBool #. , , :
var myObj = new TMyClass();
myObj.set_IndexedBool(0, true);
, - , IndexedBool, default . , , .
?