private static void WriteConfigurationCommon(XmlWriter xmlWriter, NotificationConfiguration notificationConfiguration) { if (notificationConfiguration.IsSetEvents()) { foreach (EventType @event in notificationConfiguration.Events) { xmlWriter.WriteElementString("Event", "", S3Transforms.ToXmlStringValue(ConstantClass.op_Implicit(@event))); } } if (notificationConfiguration.IsSetFilter()) { xmlWriter.WriteStartElement("Filter", ""); Filter filter = notificationConfiguration.Filter; if (filter.IsSetS3KeyFilter()) { xmlWriter.WriteStartElement("S3Key", ""); S3KeyFilter s3KeyFilter = filter.S3KeyFilter; if (s3KeyFilter.IsSetFilterRules()) { foreach (FilterRule filterRule in s3KeyFilter.FilterRules) { if (filterRule != null) { xmlWriter.WriteStartElement("FilterRule", ""); xmlWriter.WriteElementString("Name", filterRule.Name); xmlWriter.WriteElementString("Value", filterRule.Value); xmlWriter.WriteEndElement(); } } } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); } }
private static void WriteConfigurationCommon(XmlWriter xmlWriter, NotificationConfiguration notificationConfiguration) { if (notificationConfiguration.IsSetEvents()) { foreach (var evnt in notificationConfiguration.Events) { xmlWriter.WriteElementString("Event", "", S3Transforms.ToXmlStringValue(evnt)); } } if (notificationConfiguration.IsSetFilter()) { xmlWriter.WriteStartElement("Filter", ""); var filter = notificationConfiguration.Filter; if (filter.IsSetS3KeyFilter()) { xmlWriter.WriteStartElement("S3Key", ""); var s3key = filter.S3KeyFilter; if (s3key.IsSetFilterRules()) { var filterRules = s3key.FilterRules; foreach (var filterRule in filterRules) { if (filterRule != null) { xmlWriter.WriteStartElement("FilterRule", ""); xmlWriter.WriteElementString("Name", filterRule.Name); xmlWriter.WriteElementString("Value", filterRule.Value); xmlWriter.WriteEndElement(); } } } xmlWriter.WriteEndElement(); } xmlWriter.WriteEndElement(); } }