示例#1
0
        /// <summary>
        /// Create streaming endpoint data from the creation options.
        /// </summary>
        /// <param name="options">Streaming endpoint creation options.</param>
        /// <returns></returns>
        internal StreamingEndpointData(StreamingEndpointCreationOptions options)
        {
            Name        = options.Name;
            Description = options.Description;
            ScaleUnits  = options.ScaleUnits;
            CdnEnabled  = options.CdnEnabled;
            CdnProfile  = options.CdnProfile;
            CdnProvider = options.CdnProvider.ToString();
            StreamingEndpointVersion = options.StreamingEndpointVersion == null
                ? StreamingEndpointCreationOptions.DefaultVersion.ToString()
                : options.StreamingEndpointVersion.ToString();

            CrossSiteAccessPolicies = options.CrossSiteAccessPolicies;

            if (options.CustomHostNames != null)
            {
                CustomHostNames = (options.CustomHostNames as IList <string>) ??
                                  options.CustomHostNames.ToList();
            }

            _accessControl = options.AccessControl;
            _cacheControl  = options.CacheControl;

            ValidateSettings();
        }
        /// <summary>
        /// Creates an instance of StreamingEndpointCacheControlData class from an instance of StreamingEndpointCacheControl.
        /// </summary>
        /// <param name="cacheControl">StreamingEndpointCacheControl to copy into newly created instance.</param>
        public StreamingEndpointCacheControlData(StreamingEndpointCacheControl cacheControl)
        {
            if (cacheControl == null)
            {
                throw new ArgumentNullException("cacheControl");
            }

            if (cacheControl.MaxAge.HasValue)
            {
                MaxAge = (long)cacheControl.MaxAge.Value.TotalSeconds;
            }
        }
        /// <summary>
        /// Creates an instance of StreamingEndpointCacheControlData class from an instance of StreamingEndpointCacheControl.
        /// </summary>
        /// <param name="cacheControl">StreamingEndpointCacheControl to copy into newly created instance.</param>
        public StreamingEndpointCacheControlData(StreamingEndpointCacheControl cacheControl)
        {
            if (cacheControl == null)
            {
                throw new ArgumentNullException("cacheControl");
            }

            if (cacheControl.MaxAge.HasValue)
            {
                MaxAge = (long)cacheControl.MaxAge.Value.TotalSeconds;
            }
        }
示例#4
0
 internal override void Refresh()
 {
     _accessControl = null;
     _cacheControl  = null;
     base.Refresh();
 }