示例#1
0
        internal static TableServiceProperties DeserializeTableServiceProperties(XElement element)
        {
            LoggingSettings  logging       = default;
            TableMetrics     hourMetrics   = default;
            TableMetrics     minuteMetrics = default;
            IList <CorsRule> cors          = default;

            if (element.Element("Logging") is XElement loggingElement)
            {
                logging = LoggingSettings.DeserializeLoggingSettings(loggingElement);
            }
            if (element.Element("HourMetrics") is XElement hourMetricsElement)
            {
                hourMetrics = TableMetrics.DeserializeTableMetrics(hourMetricsElement);
            }
            if (element.Element("MinuteMetrics") is XElement minuteMetricsElement)
            {
                minuteMetrics = TableMetrics.DeserializeTableMetrics(minuteMetricsElement);
            }
            if (element.Element("Cors") is XElement corsElement)
            {
                var array = new List <CorsRule>();
                foreach (var e in corsElement.Elements("CorsRule"))
                {
                    array.Add(CorsRule.DeserializeCorsRule(e));
                }
                cors = array;
            }
            return(new TableServiceProperties(logging, hourMetrics, minuteMetrics, cors));
        }
示例#2
0
 internal TableServiceProperties(TableAnalyticsLoggingSettings logging, TableMetrics hourMetrics, TableMetrics minuteMetrics, IList <TableCorsRule> cors)
 {
     Logging       = logging;
     HourMetrics   = hourMetrics;
     MinuteMetrics = minuteMetrics;
     Cors          = cors;
 }