TryGetContentType() публичный Метод

public TryGetContentType ( Type type, ContentTypeRegistration &registration ) : bool
type System.Type
registration ContentTypeRegistration
Результат bool
Пример #1
0
        public bool TryGetMediaType(Type type, out MediaTypeRegistration registration)
        {
            ContentTypeRegistration reg;

            if (ContentTypeRegister.TryGetContentType(type, out reg))
            {
                registration = reg as MediaTypeRegistration;
                return(registration != null);
            }
            else
            {
                registration = null;
                return(false);
            }
        }
        public bool TryGetDocumentType(string alias, out DocumentTypeRegistration registration)
        {
            ContentTypeRegistration reg;

            if (ContentTypeRegister.TryGetContentType(alias, out reg))
            {
                registration = reg as DocumentTypeRegistration;
                return(registration != null);
            }
            else
            {
                registration = null;
                return(false);
            }
        }