Пример #1
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="log"></param>
        public ImageServer(ILoggingService log, EventLog eventLogger)
        {
            m_eventLogger = eventLogger;
            //taking info given in the config
            List <string> dest       = ConfigurationManager.AppSettings["Handler"].Split(';').ToList();
            int           thumbSize  = Int32.Parse(ConfigurationManager.AppSettings["ThumbnailSize"]);
            string        sourceName = ConfigurationManager.AppSettings["SourceName"];
            string        logName    = ConfigurationManager.AppSettings["LogName"];
            string        outputDir  = ConfigurationManager.AppSettings["OutputDir"];

            // build the config object
            m_config = new ImageServiceConfig(dest, thumbSize, sourceName, logName, outputDir);
            dm       = new DirectoryManager(log, m_config, this.OnDirClosed);
            guis     = new GUIServer(9999, log, this.OnNewMessage);
            eventLogger.EntryWritten       += WhenEntryWritten;
            eventLogger.EnableRaisingEvents = true;
            guis.Start();
        }
Пример #2
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="log"></param>
        public ImageServer(ILoggingService log, EventLog eventLogger)
        {
            m_eventLogger = eventLogger;
            //taking info given in the config
            List <string> dest       = ConfigurationManager.AppSettings["Handler"].Split(';').ToList();
            int           thumbSize  = Int32.Parse(ConfigurationManager.AppSettings["ThumbnailSize"]);
            string        sourceName = ConfigurationManager.AppSettings["SourceName"];
            string        logName    = ConfigurationManager.AppSettings["LogName"];
            string        outputDir  = ConfigurationManager.AppSettings["OutputDir"];

            // build the config object
            m_config = new ImageServiceConfig(dest, thumbSize, sourceName, logName, outputDir);
            // build the DirectoryManager
            dm = new DirectoryManager(log, m_config, this.OnDirClosed);
            // build the Server
            serv = new Communication.Server(9900, log, m_config.handlers[0]);
            // set the required event handler
            eventLogger.EnableRaisingEvents = true;
            serv.Start();             // start the Server
        }