"Jon Skeet [C# MVP]" wrote:
Pete <Pe**@discussions.microsoft.com> wrote: I am converting several small J++ applications to C# using the JLCA with
Visual Studio 2005. There are lots of errors 1209 "Method was not converted
to a property".
I'm curious as to WHY they were not converted to a property. Some
get-and-set pairs get converted, some don't, it all seems rather random.
Some get-and-set pairs are not converted because because the 'set' method is
overloaded. I can see a 1209 here I guess.
But most of the 1209 errors are for ordinary get-and-set pairs that are not
overloaded.
I'm curious as to the reasons a 1209 error would be generated.
Do they have different access (one public, one private) by any chance?
Prior to C# 2.0 that wasn't expressible in C# - perhaps the JLCA hasn't
been updated to take account of that new feature?
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Hello Jon,
In my case, the access levels were the same. However, your question
kickstarted several ideas to my brain. One of them turned out to be the
solution to the problem I was having.
If a get-and-set pair has one of the methods overloaded, the JLCA does not
convert that J++ property to a C# property. For example,
String getSomePropert() { ... }
void setSomeProperty(String) { ... }
would convert to a C# property no problem. Unfortunately my application
also has a
void setSomeProperty(int, String)
and this is what causes a 1209 from the JLCA. If that setSomeProperty(int,
String) exists in a subclass, the problem also happens.
That was the case I had going on in my application. Thank you Jon for
responding and kickstarting me down the right path. I very much appreciate
your time!