1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using System.Xml;
- namespace Wayne.Lib.Log
- {
-
-
-
- public class LogConfigEventLogSubscriptionOutput : LogConfigOutput
- {
-
-
-
- public string SubscriberId { get; set; }
-
-
-
- public LogConfigEventLogStorageType StorageType { get; set; }
- internal const string XmlType = "EventLogSubscription";
-
-
-
- public LogConfigEventLogSubscriptionOutput()
- {
- }
-
-
-
-
-
- public LogConfigEventLogSubscriptionOutput(string subscriberId, LogConfigEventLogStorageType storageType)
- {
- SubscriberId = subscriberId;
- StorageType = storageType;
- }
-
-
-
-
-
- internal LogConfigEventLogSubscriptionOutput(XmlNode parametersNode, string ns)
- {
- XmlNode eventLogParamsNode = parametersNode["EventLogSubscriptionParams", ns];
- SubscriberId = eventLogParamsNode.Attributes["SubscriberId"].Value;
- StorageType = EnumSupport.Parse(eventLogParamsNode.Attributes["StorageType"].Value, false, LogConfigEventLogStorageType.Volatile);
- }
-
-
-
-
- internal override void WriteXml(XmlWriter xmlWriter)
- {
- xmlWriter.WriteStartElement("Output");
- xmlWriter.WriteAttributeString("Type", XmlType);
- xmlWriter.WriteStartElement("Parameters");
- xmlWriter.WriteStartElement("EventLogSubscriptionParams");
- xmlWriter.WriteAttributeString("SubscriberId", SubscriberId ?? string.Empty);
- xmlWriter.WriteAttributeString("StorageType", StorageType.ToString());
- xmlWriter.WriteEndElement();
- xmlWriter.WriteEndElement();
- xmlWriter.WriteEndElement();
- }
-
-
-
-
- public override object Clone()
- {
- return new LogConfigEventLogSubscriptionOutput(SubscriberId, StorageType);
- }
- }
- }
|