/// <summary> /// Initializes a new instance of the <see cref="SyslogAuditForwarder"/> class. /// Creates a new instance of the SyslogAuditForwarder /// </summary> /// <param name="config">The </param> public SyslogAuditForwarder(IExtensionConfiguration config) { _config = config ?? throw new ArgumentNullException(nameof(config), "A constructed configuration must be provided."); if (_config.Host == null) { _killswitch = true; return; } _serializer = CreateSerializer(); _mapper = config.AuditEventMap; }
void IXmlSerializable.WriteXml(XmlWriter writer) { writer.WriteAttributeString("type", Utils.GetImplementationName <ExtensionRegistry>()); writer.WriteAttributeString("serializableType", Utils.GetImplementationName <Serializable>()); writer.WriteAttributeString("extensionPoints", _registry._extensionPoints.Count.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("extensions", _registry._extensions.Count.ToString(CultureInfo.InvariantCulture)); writer.WriteStartElement("extensionPoints"); foreach (IExtensionPoint point in _registry.ExtensionPoints) { List <ExtensionConfiguration> extensionConfigs = new List <ExtensionConfiguration>(); ExtensionPointConfiguration cfg = (ExtensionPointConfiguration)_registry.GetExtensionPointConfigurationElement(point.Id); for (int i = 0; i < point.Extensions.Length; i++) { ExtensionConfiguration extCfg = (ExtensionConfiguration)_registry.GetExtensionConfigurationElement(point.Extensions[i].Id); if (null != extCfg) { extensionConfigs.Add(extCfg); } } XmlUtils.WriteElement <ExtensionPointConfiguration>(writer, "extensionPoint", cfg); XmlUtils.WriteElementsFromList <ExtensionConfiguration>(writer, "extensions", "extension", extensionConfigs); } writer.WriteFullEndElement(); List <ExtensionConfiguration> orphanExtensionConfigs = new List <ExtensionConfiguration>(); foreach (IExtension ext in _registry._extensions.Values) { if (string.IsNullOrEmpty(ext.Point) || IsNonExistentExtensionPoint(ext.Point)) { IExtensionConfiguration cfg = _registry.GetExtensionConfigurationElement(ext.Id); ExtensionConfiguration extCfg = cfg as ExtensionConfiguration; if (null != extCfg) { orphanExtensionConfigs.Add(extCfg); } } } XmlUtils.WriteElementsFromList <ExtensionConfiguration>(writer, "extensions", "extension", orphanExtensionConfigs); }
public MockBuilderExtension Use(IExtensionConfiguration <MockBuilderExtension> visitor) { throw new NotImplementedException(); }
public Extension(IExtensionConfiguration cfg, IExtensionBuilder builder) { _configElement = cfg; _builder = builder; }
public ISnackbarExtension Use(IExtensionConfiguration <ISnackbarExtension> visitor) { visitor.Configure(this); return(this); }