The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Private classes and full type name

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Frans Bouma

Posts: 265
Nickname: fbouma
Registered: Aug, 2003

Frans Bouma is a senior software engineer for Solutions Design
Private classes and full type name Posted: Feb 23, 2004 1:25 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Frans Bouma.
Original Post: Private classes and full type name
Feed Title: Frans Bouma's blog
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/fbouma/Rss.aspx
Feed Description: Generator.CreateCoolTool();
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Frans Bouma
Latest Posts From Frans Bouma's blog

Advertisement

This morning I was checking how my Xml serialization code was doing and I stumbled upon a phenomenon I hadn't seen before: the FullName property of Type will return a '+' instead of a '.' when the class is a private class. For testing I had defined some private classes and I set a property to an instance of one of those classes. My Xml serialization code will then add an Xml node with attributes for Assembly name and Type name. When examining the produced Xml, I saw:Type="DALTester.AdapterTester+OrderEntityValidator".

"Hmmm...", I thought. Examining my Xml producing code didn't give me the idea I had done something wrong, as the same code did produce correct type names for other instances and all it did was reading the FullName property of a System.Type object. After a while debugging back and forth it hit me: OrderEntityValidator was a private class! :)

So, if you run into this issue, it's not you nor your code, it's expected behaviour. :)

Read: Private classes and full type name

Topic: Yukon and other up coming titles Previous Topic   Next Topic Topic: Geek Notes 2004-02-20

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use