private void InitTransportCapabilities()
 {
     this.transportCapabilities = new TransportCapabilities();
     this.transportCapabilities.ContentTypeNegotiated = false;
     this.transportCapabilities.ResponseBinary        = (this.desiredResponseType == DataType.CompressedBinaryXml || this.desiredResponseType == DataType.BinaryXml);
     this.transportCapabilities.ResponseCompression   = (this.desiredResponseType == DataType.CompressedBinaryXml || this.desiredResponseType == DataType.CompressedXml);
 }
 protected void SetTransportCapabilities(TransportCapabilities capabilities)
 {
     if (capabilities != null)
     {
         this.transportCapabilities = capabilities.Clone();
     }
 }
 public DimeRecord ReadRecord()
 {
     if (this.m_closed)
     {
         throw new InvalidOperationException(XmlaSR.DimeReader_IsClosed);
     }
     if (this.m_currentRecord != null)
     {
         if (this.m_currentRecord.EndOfMessage)
         {
             return(null);
         }
         this.m_currentRecord.Close();
     }
     this.m_currentRecord = new DimeRecord(this.m_stream);
     if (this.m_Options == null)
     {
         this.m_Options = this.m_currentRecord.Options;
     }
     if (this.m_currentRecord.TypeFormat == TypeFormatEnum.None && this.m_currentRecord.EndOfMessage)
     {
         this.m_currentRecord.Close();
         return(null);
     }
     return(this.m_currentRecord);
 }
예제 #4
0
 protected override void DetermineNegotiatedOptions()
 {
     if (!base.NegotiatedOptions)
     {
         TransportCapabilities transportCapabilities = this.dimeReader.Options.Clone();
         transportCapabilities.ContentTypeNegotiated = true;
         base.SetTransportCapabilities(transportCapabilities);
     }
 }
 public DimeReader(Stream stream)
 {
     if (stream == null)
     {
         throw new ArgumentNullException("stream");
     }
     if (!stream.CanRead)
     {
         throw new ArgumentException(XmlaSR.DimeReader_CannotReadFromStream);
     }
     this.m_stream  = stream;
     this.m_Options = null;
 }
 protected override void DetermineNegotiatedOptions()
 {
     if (!base.NegotiatedOptions)
     {
         this.GetResponseStream();
         TransportCapabilities transportCapabilities = new TransportCapabilities();
         if (!string.IsNullOrEmpty(this.responseFlags))
         {
             transportCapabilities.FromString(this.responseFlags);
         }
         transportCapabilities.ContentTypeNegotiated = true;
         base.SetTransportCapabilities(transportCapabilities);
     }
 }
 public DimeWriter(Stream stream)
 {
     if (stream == null)
     {
         throw new ArgumentNullException("stream");
     }
     if (!stream.CanWrite)
     {
         throw new ArgumentException(XmlaSR.DimeWriter_CannotWriteToStream, "stream");
     }
     this.m_stream           = stream;
     this.m_firstRecord      = true;
     this.m_defaultChunkSize = 1024;
     this.m_Options          = null;
 }
예제 #8
0
 protected override void DetermineNegotiatedOptions()
 {
     if (!base.NegotiatedOptions)
     {
         TransportCapabilities transportCapabilities = new TransportCapabilities();
         string text = this.httpResponse.Headers.Get(this.hasASAzureHeaders ? "x-ms-xmlacaps-negotiation-flags" : "X-Transport-Caps-Negotiation-Flags");
         if (!string.IsNullOrEmpty(text))
         {
             transportCapabilities.FromString(text);
         }
         else if (this.hasASAzureHeaders)
         {
             throw new ArgumentOutOfRangeException("x-ms-xmlacaps-negotiation-flags");
         }
         transportCapabilities.ContentTypeNegotiated = true;
         base.SetTransportCapabilities(transportCapabilities);
     }
 }
 public DimeRecord CreateRecord(Uri id, string type, TypeFormatEnum typeFormat, int contentLength)
 {
     if (type == null)
     {
         throw new ArgumentNullException("type");
     }
     if (this.m_closed)
     {
         throw new InvalidOperationException(XmlaSR.DimeWriter_WriterIsClosed);
     }
     if (this.m_currentRecord != null)
     {
         this.m_currentRecord.Close(false);
     }
     this.m_currentRecord         = new DimeRecord(this.m_stream, id, type, typeFormat, this.m_firstRecord, contentLength, this.m_defaultChunkSize);
     this.m_currentRecord.Options = this.m_Options;
     this.m_firstRecord           = false;
     return(this.m_currentRecord);
 }
 protected TransportCapabilitiesAwareXmlaStream(TransportCapabilitiesAwareXmlaStream originalStream)
 {
     this.desiredRequestType    = originalStream.desiredRequestType;
     this.desiredResponseType   = originalStream.desiredResponseType;
     this.transportCapabilities = originalStream.transportCapabilities.Clone();
 }