Peter Duniho
8/11/2008 6:19:00 PM
On Mon, 11 Aug 2008 10:58:07 -0700, Joerg Battermann
<jb@joergbattermann.com> wrote:
> does anyone know the precise naming conventions used for internal
> backing fields for automatic properties? Something official besides
> looking at the compiled assemblies that might let you 'assume' a
> certain schema...
Surely this is undocumented for a reason.
I think the best you can do is inspect what the compiler generates, and
you absolutely definitely no way should ever actually rely on that
information. The compiler could change it's behavior any time.
For what it's worth, if you have control over the code implementing the
property, you can just not use the automatically implemented property and
name the field whatever you want. Automatically implemented properties
don't add _that_ much. And if you don't have control over the code
implementing the property, I don't think you even have a reliable way to
distinguish automatically implemented properties from regular ones.
Pete