示例#1
0
文件: Main.cs 项目: dohjo/NTPR
 public Main(ISyslogDaemon daemon, bool logging)
 {
     InitializeComponent();
     this._SyslogDaemon = daemon;
     IServerStatus status = (IServerStatus)daemon;
     this._Logger = new ServerStatusLogger(ref status, Encoding.Default, true, logging, "syslog.txt");
     this._Logger.StatusChanged += new EventHandler<Just.EventArguments.StringEventArgs>(_Logger_StatusChanged);
     this._SyslogDaemon.SyslogMessageReceived += new EventHandler<Just.EventArguments.GenericEventArgs<SyslogProtocol>>(_SyslogDaemon_SyslogMessageReceived);
     this._SyslogDaemon.Start();
     this.FormClosed += new FormClosedEventHandler(Main_FormClosed);
 }
示例#2
0
        public Main(ISyslogDaemon daemon, bool logging)
        {
            InitializeComponent();
            this._SyslogDaemon = daemon;
            IServerStatus status = (IServerStatus)daemon;

            this._Logger = new ServerStatusLogger(ref status, Encoding.Default, true, logging, "syslog.txt");
            this._Logger.StatusChanged += new EventHandler <Just.EventArguments.StringEventArgs>(_Logger_StatusChanged);
            this._SyslogDaemon.SyslogMessageReceived += new EventHandler <Just.EventArguments.GenericEventArgs <SyslogProtocol> >(_SyslogDaemon_SyslogMessageReceived);
            this._SyslogDaemon.Start();
            this.FormClosed += new FormClosedEventHandler(Main_FormClosed);
        }