Posted 16 years ago
by Mitch Blake
Let's say you have the following text (C#):
using System;
...other using statements...
public class MyClass
{
TimeSpan myTimeSpanField
{
get{...}
}
}
If you are editing this doc in the SyntaxEditor, you can hover over "TimeSpan" in the property declaration and the tooptip says "System.TimeSpan". So, the editor knows how to get the full name of the type. If you comment out the "using System" line, the tooltip won't show. That's all as expected.
Now, in code, I have a PropertyDeclaration object. The PropertyDeclaration.ReturnType.Name is "TimeSpan". How can I resolve that ReturnType to the fully qualified type name "System.TimeSpan" in the same way that is used to display the tooltip when editing (I'd like it to resolve the same way so that I get the same answer as when editing the doc in the editor).
Any help is appreciated.
Thanks - Mitch
using System;
...other using statements...
public class MyClass
{
TimeSpan myTimeSpanField
{
get{...}
}
}
If you are editing this doc in the SyntaxEditor, you can hover over "TimeSpan" in the property declaration and the tooptip says "System.TimeSpan". So, the editor knows how to get the full name of the type. If you comment out the "using System" line, the tooltip won't show. That's all as expected.
Now, in code, I have a PropertyDeclaration object. The PropertyDeclaration.ReturnType.Name is "TimeSpan". How can I resolve that ReturnType to the fully qualified type name "System.TimeSpan" in the same way that is used to display the tooltip when editing (I'd like it to resolve the same way so that I get the same answer as when editing the doc in the editor).
Any help is appreciated.
Thanks - Mitch