public void RestoreInternal(XmlReader reader)
        {
            for (int i = 0; i < reader.AttributeCount; ++i)
            {
                reader.MoveToAttribute(i);
                switch (reader.Name)
                {
                case "maxevents":
                    MaxEvents = reader.ReadContentAsInt();
                    break;
                }
            }

            reader.MoveToElement();
            XmlReader subtree = reader.ReadSubtree();

            while (subtree.Read())
            {
                switch (subtree.Name)
                {
                case "event":
                    var @event = new EventConfiguration();
                    @event.Restore(reader);
                    Events.Add(@event);
                    break;
                }
            }
        }
Esempio n. 2
0
 private LogEventDefinition TryCreateDefinition(EventConfiguration configuration)
 {
     try
     {
         return(new LogEventDefinition(configuration));
     }
     catch (Exception e)
     {
         Log.ErrorFormat("Unable to create event definition from {0}: {1}",
                         configuration,
                         e);
         return(null);
     }
 }
Esempio n. 3
0
 public LogEventDefinition(EventConfiguration configuration)
     : this(configuration.FilterExpression)
 {
 }