public static PublishedItemType GetItemType(this IContentTypeBase contentType) { var type = contentType.GetType(); var itemType = PublishedItemType.Unknown; if (contentType.IsElement) { itemType = PublishedItemType.Element; } else if (typeof(IContentType).IsAssignableFrom(type)) { itemType = PublishedItemType.Content; } else if (typeof(IMediaType).IsAssignableFrom(type)) { itemType = PublishedItemType.Media; } else if (typeof(IMemberType).IsAssignableFrom(type)) { itemType = PublishedItemType.Member; } return(itemType); }