예제 #1
0
        /// <summary>
        /// Constructs a <c>ServiceProperties</c> object from an XML document received from the service.
        /// </summary>
        /// <param name="servicePropertiesDocument">The XML document.</param>
        /// <returns>A <c>ServiceProperties</c> object containing the properties in the XML document.</returns>
        internal static FileServiceProperties FromServiceXml(XDocument servicePropertiesDocument)
        {
            XElement servicePropertiesElement =
                servicePropertiesDocument.Element(ServiceProperties.StorageServicePropertiesName);

            FileServiceProperties properties = new FileServiceProperties
            {
                Cors        = ServiceProperties.ReadCorsPropertiesFromXml(servicePropertiesElement.Element(ServiceProperties.CorsName)),
                HourMetrics = ServiceProperties.ReadMetricsPropertiesFromXml(
                    servicePropertiesElement.Element(ServiceProperties.HourMetricsName)),
                MinuteMetrics = ServiceProperties.ReadMetricsPropertiesFromXml(
                    servicePropertiesElement.Element(ServiceProperties.MinuteMetricsName))
            };

            return(properties);
        }