Пример #1
0
        internal static QueueServiceProperties DeserializeQueueServiceProperties(XElement element)
        {
            QueueAnalyticsLogging logging       = default;
            QueueMetrics          hourMetrics   = default;
            QueueMetrics          minuteMetrics = default;
            IList <QueueCorsRule> cors          = default;

            if (element.Element("Logging") is XElement loggingElement)
            {
                logging = QueueAnalyticsLogging.DeserializeQueueAnalyticsLogging(loggingElement);
            }
            if (element.Element("HourMetrics") is XElement hourMetricsElement)
            {
                hourMetrics = QueueMetrics.DeserializeQueueMetrics(hourMetricsElement);
            }
            if (element.Element("MinuteMetrics") is XElement minuteMetricsElement)
            {
                minuteMetrics = QueueMetrics.DeserializeQueueMetrics(minuteMetricsElement);
            }
            if (element.Element("Cors") is XElement corsElement)
            {
                var array = new List <QueueCorsRule>();
                foreach (var e in corsElement.Elements("CorsRule"))
                {
                    array.Add(QueueCorsRule.DeserializeQueueCorsRule(e));
                }
                cors = array;
            }
            return(new QueueServiceProperties(logging, hourMetrics, minuteMetrics, cors));
        }
 internal QueueServiceProperties(QueueAnalyticsLogging logging, QueueMetrics hourMetrics, QueueMetrics minuteMetrics, IList <QueueCorsRule> cors)
 {
     Logging       = logging;
     HourMetrics   = hourMetrics;
     MinuteMetrics = minuteMetrics;
     Cors          = cors;
 }