示例#1
0
文件: Service1.cs 项目: xsolon/if
        public void DoWork()
        {
            var source = new ExtendedTraceSource("ServerComponent");

            try
            {
                using (var lScope = new LogicalOperationScope(source, "Process C"))
                {
                    var sample2 = new MyServerComponent(source);

                    sample2.TraceEvent(TraceEventType.Information, 10, "Server Message for the Process");
                }

                Trace.WriteLine("Hi");
                Console.WriteLine("HIII");
            }
            catch (Exception ex)
            {
                source.TraceEvent(TraceEventType.Error, 11, ex.ToString());
                Trace.WriteLine(ex.ToString());
                Console.WriteLine(ex.ToString());
            }
            finally {
                source.Close();
            }
        }
示例#2
0
文件: Service1.cs 项目: xsolon/if
 public MyServerComponent(ExtendedTraceSource source) : base(source)
 {
 }