public static string GetClassName(object component, bool noCustomTypeDesc) {
if (component == null) {
throw new ArgumentNullException("component");
}
if (System.Runtime.InteropServices.Marshal.IsComObject(component)) {
// Do not rip this varible -- it is here to make the get to
// this static variable thread-safe.
//
#pragma warning disable 618
IComNativeDescriptorHandler handler = comNativeDescriptorHandler;
#pragma warning restore 618
if (handler != null) {
return handler.GetClassName(component);
}
}
if (!noCustomTypeDesc && component is ICustomTypeDescriptor) {
string str = ((ICustomTypeDescriptor)component).GetClassName();
if (str != null) {
return str;
}
}
return component.GetType().FullName;
}