/// <summary> /// Initializes a new instance of the ServiceProperties class. /// </summary> public ServiceProperties(LoggingProperties logging, MetricsProperties hourMetrics, MetricsProperties minuteMetrics, CorsProperties cors, DeleteRetentionPolicy deleteRetentionPolicy, StaticWebsiteProperties staticWebsite = null) { this.Logging = logging; this.HourMetrics = hourMetrics; this.MinuteMetrics = minuteMetrics; this.Cors = cors; this.DeleteRetentionPolicy = deleteRetentionPolicy; this.StaticWebsite = staticWebsite; }
/// <summary> /// Generates XML representing the given logging properties. /// </summary> /// <param name="logging">The logging properties.</param> /// <returns>An XML logging element.</returns> private static XElement GenerateLoggingXml(LoggingProperties logging) { if ((LoggingOperations.All & logging.LoggingOperations) != logging.LoggingOperations) { throw new InvalidOperationException(SR.InvalidLoggingLevel); } if (string.IsNullOrEmpty(logging.Version)) { throw new InvalidOperationException(SR.LoggingVersionNull); } return(new XElement( LoggingName, new XElement(VersionName, logging.Version), new XElement(DeleteName, (logging.LoggingOperations & LoggingOperations.Delete) != 0), new XElement(ReadName, (logging.LoggingOperations & LoggingOperations.Read) != 0), new XElement(WriteName, (logging.LoggingOperations & LoggingOperations.Write) != 0), GenerateRetentionPolicyXml(logging.RetentionDays))); }
/// <summary> /// Initializes a new instance of the ServiceProperties class. /// </summary> public ServiceProperties(LoggingProperties logging = null, MetricsProperties hourMetrics = null, MetricsProperties minuteMetrics = null, CorsProperties cors = null, DeleteRetentionPolicy deleteRetentionPolicy = null) : this(logging, hourMetrics, minuteMetrics, cors, deleteRetentionPolicy, staticWebsite : null) { }