System.ComponentModel.TypeDescriptor.GetDescriptor C# (CSharp) Method

GetDescriptor() static private method

Returns a custom type descriptor for the given instance. Performs arg checking so callers don't have to. This will call through to instance if it is a custom type descriptor.
static private GetDescriptor ( object component, bool noCustomTypeDesc ) : ICustomTypeDescriptor
component object
noCustomTypeDesc bool
return ICustomTypeDescriptor
        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;
        }

Same methods

TypeDescriptor::GetDescriptor ( Type type, string typeName ) : ICustomTypeDescriptor