Beispiel #1
0
        public RecentLogEntry(ILogProviderFactoryRegistry registry, string recentLogEntryString, string annotation, DateTime?useTimestampUtc)
        {
            var    m       = MatchRecentLogEntryString(recentLogEntryString);
            string company = m.Groups["company"].Value;
            string name    = m.Groups["name"].Value;

            this.Factory = registry.Find(company, name);
            if (Factory == null)
            {
                throw new FormatNotRegistedException(company, name);
            }
            this.ConnectionParams = new ConnectionParams(m.Groups["connectStr"].Value);
            ConnectionParamsUtils.ValidateConnectionParams(ConnectionParams, Factory);
            this.Annotation      = annotation;
            this.UseTimestampUtc = useTimestampUtc;
        }
Beispiel #2
0
 public RecentLogEntry(ILogProviderFactory factory, IConnectionParams connectionParams, string annotation, DateTime?useTimestampUtc)
 {
     if (factory == null)
     {
         throw new ArgumentNullException("factory");
     }
     if (connectionParams == null)
     {
         throw new ArgumentNullException("connectionParams");
     }
     this.Factory          = factory;
     this.ConnectionParams = connectionParams;
     this.Annotation       = annotation;
     this.UseTimestampUtc  = useTimestampUtc;
     ConnectionParamsUtils.ValidateConnectionParams(ConnectionParams, Factory);
 }