/// <summary>
        /// Update the Writer by Name
        /// </summary>
        /// <param name="logWriter">the new LogWriter with the same name</param>
        public void UpdateWriter(IWriteLogData <T> logWriter)
        {
            var writer = LogWriters.First(w => w.Name == logWriter.Name);

            if (writer != null)
            {
                writer = logWriter;
            }
        }
 /// <summary>
 /// Add Writer to Logger
 /// </summary>
 /// <param name="logWriter">Writer of log Data</param>
 public void AddWriter(IWriteLogData <T> logWriter)
 {
     if (!LogWriters.Any(w => w.Name == logWriter.Name))
     {
         LogWriters.Add(logWriter);
         LogWriters.Sort();
     }
     else
     {
         UpdateWriter(logWriter);
     }
 }
 private bool ActivateType(Type type, out IWriteLogData <T> instantiatedObject)
 {
     instantiatedObject = (IWriteLogData <T>)Activator.CreateInstance(type);
     return(true);
 }
Ejemplo n.º 4
0
 public int CompareTo(IWriteLogData <LogData> other)
 {
     return(SortOrder - other.SortOrder);
 }
Ejemplo n.º 5
0
 public int Compare(IWriteLogData <LogData> x, IWriteLogData <LogData> y)
 {
     return(x.SortOrder.CompareTo(y));
 }