Thank you Wen Yuan,
This did answer my question, but it took a lot of work to implement. My
original code did not use any namespace so I had to modify and test some 3000
lines of code to make sure this would work. I think it would be easier if
there was some was you could subclass the XElement, provide your own
namespace and then global search and replace would be much easier.
Then you could do this:
Where you had this:
guiNodes = xdoc.Element(GlobalArrtib.tabNameSpace +
"AutoDoc").Element(GlobalArrtib.tabNameSpace +
"TabPage").Element(GlobalArrtib.tabNameSpace + "DetailView");
replace with this:
//Global definition of your Element types...
ElementAutoDoc ad = ElementAutoDoc();
ad.NameSpace = GlobalArrtib.autoDocNameSpace;
ElementAutoDocTabPage adtp= ElementAutoDocTabPage();
adtp.NameSpace = GlobalArrtib.tabPageNameSpace;
ElementAutoDocDetail add = ElementAutoDocDetail();
add.NameSpace = GlobalArrtib.detailNameSpace;
the you can have:
//code implimentation
guiNodes =
xdoc.ElementAutoDoc("AutoDoc").ElementAutoDocTabPage("TabPage").ElementAutoDocDetail ("DetailView");
Which is much cleaner.
The current version cause a lot of string concatenation.
Is there any plan on implementing LINQ to XML the way it's done in VB with
C#? That is much cleaner.
Alexander L. Wykel

Signature
Alexander L. Wykel
AW Software Works
> Hello Alexander,
>
[quoted text clipped - 37 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
Wen Yuan Wang [MSFT] - 16 Apr 2008 05:44 GMT
Hello Alexander,
Thanks for your reply, and posting back your solution.
Extending the XElement class is really great idea for default namespace. I
think other guys will get benefit from your reply.
Please understand this is the first version of LINQ to XML. Thereby, we are
looking at continual improvement. But I'm not sure if C# team has a plan to
support XML as the way in VB. I suggest you can submit this feedback to our
connect feedback portal. This kind of feedback that let product team know
what things you're trying to do, that we haven't yet exposed for you. Our
developer will evaluate them seriously and communicate with you directly on
the issue there.
http://connect.microsoft.com/VisualStudio/
Improving the quality of our products and services is a never ending
process for Microsoft.
Thanks again for your suggestion and feedback. If you have any more concern
or there is anyting we can help with, please feel free to let us know. We
are glad to assist you.
Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.