System.ComponentModel.DebugTypeDescriptor.ComponentEntry.GetService C# (CSharp) Method

GetService() private method

private GetService ( object component, Type type ) : object
component object
type System.Type
return object
            private object GetService(object component, Type type) {
                if (component == null) {
                    throw new ArgumentNullException("component");
                }

                if (component is IComponent) 
                {
                    ISite site = ((IComponent)component).Site;
                    if (site != null) {
                        return site.GetService(type);
                    }
                }
                return null;
            }