Пример #1
0
 public CsvOutputContext(
     ODataFormat format,
     ODataMessageWriterSettings settings,
     ODataMessageInfo messageInfo,
     bool synchronous)
     : base(format, settings, messageInfo.IsResponse, synchronous, messageInfo.Model, messageInfo.UrlResolver)
 {
     this.stream = messageInfo.GetMessageStream();
     this.Writer = new StreamWriter(this.stream);
 }
Пример #2
0
 /// <summary>
 /// Detects the payload kinds supported by this format for the specified message payload.
 /// </summary>
 /// <param name="messageInfo">The context information for the message.</param>
 /// <param name="settings">Configuration settings of the OData reader.</param>
 /// <returns>The set of <see cref="ODataPayloadKind"/>s that are supported with the specified payload.</returns>
 public override IEnumerable <ODataPayloadKind> DetectPayloadKind(
     ODataMessageInfo messageInfo,
     ODataMessageReaderSettings settings)
 {
     ExceptionUtils.CheckArgumentNotNull(messageInfo, "messageInfo");
     return(this.DetectPayloadKindImplementation(
                messageInfo.GetMessageStream(),
                messageInfo.IsResponse,
                new ODataPayloadKindDetectionInfo(
                    messageInfo.MediaType,
                    messageInfo.Encoding,
                    settings,
                    messageInfo.Model)));
 }
Пример #3
0
 /// <summary>
 /// Detects the payload kinds supported by this format for the specified message payload.
 /// </summary>
 /// <param name="messageInfo">The context information for the message.</param>
 /// <param name="settings">Configuration settings of the OData reader.</param>
 /// <returns>The set of <see cref="ODataPayloadKind"/>s that are supported with the specified payload.</returns>
 public override IEnumerable<ODataPayloadKind> DetectPayloadKind(
     ODataMessageInfo messageInfo,
     ODataMessageReaderSettings settings)
 {
     ExceptionUtils.CheckArgumentNotNull(messageInfo, "messageInfo");
     return this.DetectPayloadKindImplementation(
             messageInfo.GetMessageStream(),
             messageInfo.IsResponse,
             new ODataPayloadKindDetectionInfo(
                 messageInfo.MediaType,
                 messageInfo.Encoding,
                 settings,
                 messageInfo.Model));
 }
Пример #4
0
        /// <summary>
        /// Creates an instance of the input context for this format.
        /// </summary>
        /// <param name="messageInfo">The context information for the message.</param>
        /// <param name="messageReaderSettings">Configuration settings of the OData reader.</param>
        /// <returns>The newly created input context.</returns>
        public override ODataInputContext CreateInputContext(
            ODataMessageInfo messageInfo,
            ODataMessageReaderSettings messageReaderSettings)
        {
            ExceptionUtils.CheckArgumentNotNull(messageInfo, "messageInfo");
            ExceptionUtils.CheckArgumentNotNull(messageReaderSettings, "messageReaderSettings");

            return new ODataAtomInputContext(
                this,
                messageInfo.GetMessageStream(),
                messageInfo.Encoding,
                messageReaderSettings,
                messageInfo.IsResponse,
                /*synchronous*/ true,
                messageInfo.Model,
                messageInfo.UrlResolver);
        }
Пример #5
0
        /// <summary>
        /// Creates an instance of the output context for this format.
        /// </summary>
        /// <param name="messageInfo">The context information for the message.</param>
        /// <param name="messageWriterSettings">Configuration settings of the OData writer.</param>
        /// <returns>The newly created output context.</returns>
        public override ODataOutputContext CreateOutputContext(
            ODataMessageInfo messageInfo,
            ODataMessageWriterSettings messageWriterSettings)
        {
            ExceptionUtils.CheckArgumentNotNull(messageInfo, "messageInfo");
            ExceptionUtils.CheckArgumentNotNull(messageWriterSettings, "messageWriterSettings");

            return(new ODataAtomOutputContext(
                       this,
                       messageInfo.GetMessageStream(),
                       messageInfo.Encoding,
                       messageWriterSettings,
                       messageInfo.IsResponse,
                       /*synchronous*/ true,
                       messageInfo.Model,
                       messageInfo.UrlResolver));
        }
Пример #6
0
 public override ODataOutputContext CreateOutputContext(ODataMessageInfo messageInfo, ODataMessageWriterSettings messageWriterSettings)
 {
     return(new VCardOutputContext(this, messageInfo.GetMessageStream(), messageInfo.Encoding, messageWriterSettings, messageInfo.IsResponse, true, messageInfo.Model, messageInfo.UrlResolver));
 }
Пример #7
0
 public override ODataInputContext CreateInputContext(ODataMessageInfo messageInfo, ODataMessageReaderSettings messageReaderSettings)
 {
     return(new VCardInputContext(this, messageInfo.GetMessageStream(), messageInfo.MediaType, messageInfo.Encoding, messageReaderSettings, messageInfo.IsResponse, true, messageInfo.Model, messageInfo.UrlResolver));
 }