Great! I will give that a try and let you know.

Thanks!

rbr

On Jan 14, 11:05 am, Anachronistic <[email protected]> wrote:
> rbr,
>
> I know the issue you're describing. With an object Tobj with a single
> public property called "property" with auto accessors and mutators,
> the following code won't work.
>
> class Program
> {
>      List<Tobj> list;
>
>      void SomeFunction()
>       {
>           list = new List<Tobj>();
>           foreach (var element in list)
>           {
>                int foo = element.property;
>           }
>      }
>
> }
>
> You need to cast to the object type before this will work, as in the
> following:
>
> int foo = (Tobj)element.property;
>
> Give that a try and see if it helps.
>
> Alan
>
> http://www.twitter.com/anachronistic

Reply via email to