ActivityTrace.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Activities / ActivityTrace.cs / 1305376 / ActivityTrace.cs

                            namespace System.Workflow.Activities 
{
    using System;
    using System.Diagnostics;
 

    internal static class WorkflowActivityTrace 
    { 
        static TraceSource activity;
        static TraceSource rules; 

        internal static TraceSource Activity
        {
            get { return activity; } 
        }
 
        internal static TraceSource Rules 
        {
            get { return rules; } 
        }

        /// 
        /// Statically set up trace sources 
        ///
        /// To enable logging to a file, add lines like the following to your app config file. 
        /* 
            
                 
                    
                
            
        */ 
        /// To enable tracing to default trace listeners, add lines like the following
        /* 
             
                
                     
                
            
        */
        ///  
        static WorkflowActivityTrace()
        { 
            activity = new TraceSource("System.Workflow.Activities"); 
            activity.Switch = new SourceSwitch("System.Workflow.Activities", SourceLevels.Off.ToString());
 
            rules = new TraceSource("System.Workflow.Activities.Rules");
            rules.Switch = new SourceSwitch("System.Workflow.Activities.Rules", SourceLevels.Off.ToString());

            foreach (TraceListener listener in Trace.Listeners) 
            {
                if (!(listener is DefaultTraceListener)) 
                { 
                    activity.Listeners.Add(listener);
                    rules.Listeners.Add(listener); 
                }
            }
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
namespace System.Workflow.Activities 
{
    using System;
    using System.Diagnostics;
 

    internal static class WorkflowActivityTrace 
    { 
        static TraceSource activity;
        static TraceSource rules; 

        internal static TraceSource Activity
        {
            get { return activity; } 
        }
 
        internal static TraceSource Rules 
        {
            get { return rules; } 
        }

        /// 
        /// Statically set up trace sources 
        ///
        /// To enable logging to a file, add lines like the following to your app config file. 
        /* 
            
                 
                    
                
            
        */ 
        /// To enable tracing to default trace listeners, add lines like the following
        /* 
             
                
                     
                
            
        */
        ///  
        static WorkflowActivityTrace()
        { 
            activity = new TraceSource("System.Workflow.Activities"); 
            activity.Switch = new SourceSwitch("System.Workflow.Activities", SourceLevels.Off.ToString());
 
            rules = new TraceSource("System.Workflow.Activities.Rules");
            rules.Switch = new SourceSwitch("System.Workflow.Activities.Rules", SourceLevels.Off.ToString());

            foreach (TraceListener listener in Trace.Listeners) 
            {
                if (!(listener is DefaultTraceListener)) 
                { 
                    activity.Listeners.Add(listener);
                    rules.Listeners.Add(listener); 
                }
            }
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK