internal static ICustomTypeDescriptor GetDescriptor(object component, bool noCustomTypeDesc)
{
if (component == null)
{
throw new ArgumentException(nameof(component));
}
if (component is IUnimplemented)
{
throw new NotSupportedException(SR.Format(SR.TypeDescriptorUnsupportedRemoteObject, component.GetType().FullName));
}
ICustomTypeDescriptor desc = NodeFor(component).GetTypeDescriptor(component);
ICustomTypeDescriptor d = component as ICustomTypeDescriptor;
if (!noCustomTypeDesc && d != null)
{
desc = new MergedTypeDescriptor(d, desc);
}
return desc;
}