コード例 #1
0
        private void Employee_eventHandler(EmployeeActionArgs args)
        {
            var threadStart = new ThreadStart(() =>
            {
                lock (locker)
                {
                    var writer = GetWriter();
                    LogEmployeeEvent(writer, employee, args);
                    writer.Close();
                }
            });
            var thread = new Thread(threadStart)
            {
                IsBackground = true
            };

            thread.Start();
        }
コード例 #2
0
 /// <summary>
 /// Логгирование события пользователя
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="emp"></param>
 /// <param name="args"></param>
 private void LogEmployeeEvent(TextWriter writer, T emp, EmployeeActionArgs args)
 {
     writer.WriteLine("Employee:{0}, Action:{1}", emp.name, args.ActionType);
     writer.WriteLine();
 }