Exemplo n.º 1
0
 /// <summary>
 /// Create settings based on existing settings.
 /// </summary>
 /// <param name="settings">Settings to copy.</param>
 public NntpSettings(NntpSettings settings)
 {
     bindings             = settings.bindings;
     dataProviderType     = settings.dataProviderType;
     DataProviderSettings = settings.DataProviderSettings;
     name = settings.name;
 }
Exemplo n.º 2
0
        /// <summary>
        /// NNTP Connection Manager constructor
        /// </summary>
        public Manager(NntpSettings settings)
        {
            if (!typeof(IDataProvider).IsAssignableFrom(settings.DataProviderType))
            {
                throw new ArgumentException("DataProviderType in settings object is not implemented DataProvider interface.",
                                            "settings");
            }

            this.settings = settings;
            logger        = LogManager.GetLogger(settings.Name);

            stopEvent = new ManualResetEvent(false);
            sessions  = new List <Session>();

#if PERFORMANCE_COUNTERS
            // create performance counters
            CreatePerformanceCounters(performanceCounters, settings.Name);
#endif
        }