Пример #1
0
        public StringProvider(IHandler parent, string data, FlexibleContentType contentType)
        {
            Parent = parent;

            Content     = new StringContent(data);
            ContentType = contentType;
        }
Пример #2
0
        public DownloadProvider(IHandler parent, IResourceProvider resourceProvider, FlexibleContentType contentType)
        {
            Parent = parent;

            ResourceProvider = resourceProvider;
            ContentType      = contentType;
        }
Пример #3
0
        public BundleProvider(IHandler parent, IEnumerable <IResourceProvider> items, FlexibleContentType contentType)
        {
            Parent = parent;

            ContentType = contentType;
            Items       = items;
        }
Пример #4
0
        public ContentElement(string path, string title, FlexibleContentType contentType, IEnumerable <ContentElement>?children = null)
        {
            Path     = path;
            Title    = title;
            Children = children;

            ContentType = contentType;
        }
Пример #5
0
        public ContentElement(string path, ContentInfo details, FlexibleContentType contentType, IEnumerable <ContentElement>?children = null)
        {
            Path    = path;
            Details = details;

            Children = children;

            ContentType = contentType;
        }
Пример #6
0
 private ISerializationFormat?GetFormat(FlexibleContentType contentType)
 {
     return(Formats.ContainsKey(contentType) ? Formats[contentType] : null);
 }
Пример #7
0
 public SerializationRegistry(FlexibleContentType defaultType,
                              Dictionary <FlexibleContentType, ISerializationFormat> formats)
 {
     Default = defaultType;
     Formats = formats;
 }
Пример #8
0
 public SerializationBuilder Add(FlexibleContentType contentType, ISerializationFormat format)
 {
     _Registry[contentType] = format;
     return(this);
 }
Пример #9
0
 public SerializationBuilder Default(FlexibleContentType contentType)
 {
     _Default = contentType;
     return(this);
 }
Пример #10
0
 public static IEnumerable <ContentElement> GetContent(this IHandler handler, IRequest request, ContentInfo details, FlexibleContentType contentType)
 {
     return(new List <ContentElement>()
     {
         new ContentElement(handler.GetRoot(request, false), details, contentType, null)
     });
 }
Пример #11
0
 public BundleBuilder ContentType(FlexibleContentType type)
 {
     _ContentType = type;
     return(this);
 }
Пример #12
0
 public static IEnumerable <ContentElement> GetContent(this IHandler handler, IRequest request, string title, FlexibleContentType contentType)
 {
     return(new List <ContentElement>()
     {
         new ContentElement(handler.GetRoot(request.Server.Handler, false), title, contentType, null)
     });
 }
Пример #13
0
 public IResponseBuilder Type(FlexibleContentType contentType)
 {
     _ContentType = contentType;
     return(this);
 }
Пример #14
0
 public ContentElement(WebPath path, ContentInfo details, FlexibleContentType contentType, IEnumerable <ContentElement>?children = null)
     : this(path.ToString(), details, contentType, children)
 {
 }
Пример #15
0
 public ContentElement(WebPath path, string title, FlexibleContentType contentType, IEnumerable <ContentElement>?children = null)
     : this(path.ToString(), title, contentType, children)
 {
 }