MC++ indexed properties and C#
-
Hello All, I have a project in MC++ consisting of several components/controls. Many parts used indexed properties. These are recognized in VB.NET as properties, and shows in the VB.NET code browser as such. However, in C#, the indexed properties are seen as methods; get_Item/set_Item instead of the Item property in the following:
__property String __gc* get_Item(Int32 index)
{
}
__property void set_Item(Int32 index, String __gc* value)
{
}Is this a known problem? is there anyway to work around it? It is becoming very difficult to document our components. Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.
-
Hello All, I have a project in MC++ consisting of several components/controls. Many parts used indexed properties. These are recognized in VB.NET as properties, and shows in the VB.NET code browser as such. However, in C#, the indexed properties are seen as methods; get_Item/set_Item instead of the Item property in the following:
__property String __gc* get_Item(Int32 index)
{
}
__property void set_Item(Int32 index, String __gc* value)
{
}Is this a known problem? is there anyway to work around it? It is becoming very difficult to document our components. Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.
Hi Paul Put
[ DefaultMember( "Item" ) ]
before your class declaration Regards, Nish p.s. I answered this in the newsgroup too (then saw this post and confirmed that you and he are the same :-)) p.s. #2 - I posted this here too so you'll find it earlier :-)
"I'm a bit bored at the moment so I'm thinking about writing a new programming language" - Colin Davies My book :- Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]
-
Hi Paul Put
[ DefaultMember( "Item" ) ]
before your class declaration Regards, Nish p.s. I answered this in the newsgroup too (then saw this post and confirmed that you and he are the same :-)) p.s. #2 - I posted this here too so you'll find it earlier :-)
"I'm a bit bored at the moment so I'm thinking about writing a new programming language" - Colin Davies My book :- Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]
Thanks. Nishant S wrote: p.s. I answered this in the newsgroup too (then saw this post and confirmed that you and he are the same ) Read that too. Andre claims it is a bug. It works with VB.NET without marking it as DefaultMember. I do not know when the MC++ team will have put a real working compiler for .NET - it is still too buggy ;P BTW, should it be DefaultMember or DefaultProperty? Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.
-
Thanks. Nishant S wrote: p.s. I answered this in the newsgroup too (then saw this post and confirmed that you and he are the same ) Read that too. Andre claims it is a bug. It works with VB.NET without marking it as DefaultMember. I do not know when the MC++ team will have put a real working compiler for .NET - it is still too buggy ;P BTW, should it be DefaultMember or DefaultProperty? Best regards, Paul. Jesus Christ is LOVE! Please tell somebody.
Paul Selormey wrote: Andre claims it is a bug Well, I did not say it is a bug. All I said was that a) As DefaultMember makes the property in question the indexer for C# (e.g. public string this[int index]{get; set;} ), there can be only one indexed property in C# b) The way the indexer is accessed (instance[5] instead of what on expect for a indexed property instance.MyProp[5]) makes the class look array-like. So, after all, it is not a missing feature in MC++ (which supports indexed properties), but more of a missing feature in the C# specifications. (BTW. it is System.Reflection.DefaultMemberAttribute) Best regards, Andre P.S.: damn, i hate it when I have to rewrite the whole post just because I forgot to log in :)