Exemple #1
0
 /// <summary>
 /// Dispose the stream provider instance
 /// </summary>
 internal void DisposeProvider()
 {
     if (this.streamProvider != null)
     {
         WebUtil.Dispose(this.streamProvider);
         this.streamProvider = null;
     }
 }
Exemple #2
0
        /// <summary>
        /// Asks the data service for a stream provider instance.  Throw if none is implemented.
        /// </summary>
        /// <param name="dataService">data service instance</param>
        /// <returns>stream provider instance</returns>
        internal static IDataServiceStreamProvider LoadStreamProvider(IDataService dataService)
        {
            IDataServiceStreamProvider streamProvider = dataService.Provider.GetService <IDataServiceStreamProvider>(dataService);

            if (streamProvider == null)
            {
                throw new DataServiceException(500, Strings.DataServiceStreamProviderWrapper_MustImplementIDataServiceStreamProviderToSupportStreaming);
            }

            return(streamProvider);
        }
Exemple #3
0
 private void LoadStreamProvider()
 {
     if (this.streamProvider == null)
     {
         if (this.dataService.Configuration.DataServiceBehavior.MaxProtocolVersion >= DataServiceProtocolVersion.V3)
         {
             this.streamProvider = this.dataService.Provider.GetService <IDataServiceStreamProvider2>();
         }
         if (this.streamProvider == null)
         {
             this.streamProvider = this.dataService.Provider.GetService <IDataServiceStreamProvider>();
         }
     }
 }
Exemple #4
0
        /// <summary>
        /// Asks the data service for a stream provider instance.  Throw if none is implemented.
        /// </summary>
        /// <remarks>
        /// If GetService returns two different object instances for IDataServiceStreamProvider and IDataServiceStreamProvider2,
        /// LoadStreamProvider always use the instance from GetService(IDataServiceStreamProvider2) for this.streamProvider.
        /// </remarks>
        private void LoadStreamProvider()
        {
            if (this.streamProvider == null)
            {
                // First attempt to load IDataServiceStreamProvider2 first.
                // This makes call order predictable. And if a service contains both MLEs and named streams, we can be certain
                // that the instance returned from GetService<IDSSP2> can be casted to IDSSP, but the reverse might not be true.
                this.streamProvider = this.dataService.Provider.GetService <IDataServiceStreamProvider2>();

                if (this.streamProvider == null)
                {
                    // Load IDataServiceStreamProvider if MaxProtocolVersion is V1/V2 or the V3+ service doesn't implement IDataServiceStreamProvider2.
                    this.streamProvider = this.dataService.Provider.GetService <IDataServiceStreamProvider>();
                }
            }
        }
Exemple #5
0
 /// <summary>
 /// Constructs an instance of the stream provider.
 /// </summary>
 /// <param name="streamCache">Storage for the streams</param>
 public DSPStreamProvider(DSPMediaResourceStorage streamCache)
 {
     this.provider = new DSPStreamProvider2(streamCache);
 }
 /// <summary>
 /// Constructs an instance of the stream provider.
 /// </summary>
 /// <param name="streamCache">Storage for the streams</param>
 public DSPStreamProvider(DSPMediaResourceStorage streamCache)
 {
     this.provider = new DSPStreamProvider2(streamCache);
 }