__property strangeness behavious

G

Guest

Hi,

If I make a __gc type with __property set and get I set them to private:,
those 2 methods are private ok but the actual generated property is public
according to the object browser yet its not visible in C#. WTF?

What kind of tosh is this ?
 
K

Kevin Yu [MSFT]

Hi,

Thank you for posting in the community!

We have reviewed this issue and are currently working on it. We will reply
to you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
T

Tomas Restrepo \(MVP\)

If I make a __gc type with __property set and get I set them to
private:,
those 2 methods are private ok but the actual generated property is public
according to the object browser yet its not visible in C#. WTF?

What kind of tosh is this ?

Properties themselves are just metadata. No more.
With that, properties have no accesibility themselves; however, the methods
that conform it *do* have.

When you write in any .NET language a call to a property (say, to get it's
value), what actually is generated is a direct call to the corresponding
method (i.e. get_XXX in this case); that's it. So, if you make them private,
then no one will be able to call them outside the class.
 
G

Gary Chang

Hi,

Thanks for posting in the community.

MVP Tomas figured out:
Properties themselves are just metadata. No more.
Tell that to the object browser :D

yes, it seems a little inconsistent of the property entry in the Object
Browser in VS.NET IDE.

Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top