Beispiel #1
0
        public void LogicalThenActivity()
        {
            var source = new ExtendedTraceSource();

            using (var lScope = new LogicalOperationScope(source, "Process C"))
            {

                var sample2 = new SampleClass(source);

                using (var scope = new ActivityScope(source, "Login"))
                {

                    sample2.TraceEvent(TraceEventType.Verbose, 1, "Logged in!");
                }

                using (var scope = new ActivityScope(source, "Validate"))
                {

                    //var service = new TracingTests.ServiceReference1.Service1Client("BasicHttpBinding_IService1");

                    //service.DoWork();

                    sample2.TraceEvent(TraceEventType.Verbose, 2, "Request is Valid");
                }

                using (var scope = new ActivityScope(source, "Update"))
                {
                    sample2.TraceEvent(TraceEventType.Verbose, 3, "Record updating");

                    using (var scope1 = new ActivityScope(source, "COmmit"))
                    {

                        sample2.TraceEvent(TraceEventType.Verbose, 4, "Commit worked");
                    }

                }

            }
        }
Beispiel #2
0
        void ServerCall()
        {
            var source = new ExtendedTraceSource("ServerComponent");

            using (var lScope = new LogicalOperationScope(source, "Process B"))
            {

                var sample2 = new SampleClass(source);

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

            }
        }