Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Trace.cs / 1305376 / Trace.cs
namespace System.Workflow.Runtime { using System; using System.Diagnostics; ////// Holds trace sources for the runtime and associated modules /// internal static class WorkflowTrace { static TraceSource runtime; static TraceSource tracking; static TraceSource host; ////// Tracesource for the core runtime /// internal static TraceSource Runtime { get { return runtime; } } ////// Tracesource for tracking /// internal static TraceSource Tracking { get { return tracking; } } ////// Tracesource for the host /// internal static TraceSource Host { get { return host; } } ////// Statically set up trace sources /// /// To enable logging to a file, add lines like the following to your app config file. /* static WorkflowTrace() { runtime = new TraceSource("System.Workflow.Runtime"); runtime.Switch = new SourceSwitch("System.Workflow.Runtime", SourceLevels.Off.ToString()); // we'll use ID of 1 for the scheduler, 0 for rest of runtime tracking = new TraceSource("System.Workflow.Runtime.Tracking"); tracking.Switch = new SourceSwitch("System.Workflow.Runtime.Tracking", SourceLevels.Off.ToString()); host = new TraceSource("System.Workflow.Runtime.Hosting"); host.Switch = new SourceSwitch("System.Workflow.Runtime.Hosting", SourceLevels.Off.ToString()); BooleanSwitch logToFile = new BooleanSwitch("System.Workflow LogToFile", "Log traces to file"); if (logToFile.Enabled) { TextWriterTraceListener fileLog = new TextWriterTraceListener("WorkflowTrace.log"); // add to global Listeners list Trace.Listeners.Add(fileLog); // don't add to tracking (which probably has its own log) runtime.Listeners.Add(fileLog); host.Listeners.Add(fileLog); } BooleanSwitch traceToDefault = new BooleanSwitch("System.Workflow LogToTraceListeners", "Trace to listeners in Trace.Listeners", "0"); if (traceToDefault.Enabled) { foreach (TraceListener listener in Trace.Listeners) { if (!(listener is DefaultTraceListener)) { runtime.Listeners.Add(listener); tracking.Listeners.Add(listener); host.Listeners.Add(listener); } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Workflow.Runtime { using System; using System.Diagnostics; ///*/ /// To enable tracing to default trace listeners, add lines like the following /* */ /// /// Holds trace sources for the runtime and associated modules /// internal static class WorkflowTrace { static TraceSource runtime; static TraceSource tracking; static TraceSource host; ////// Tracesource for the core runtime /// internal static TraceSource Runtime { get { return runtime; } } ////// Tracesource for tracking /// internal static TraceSource Tracking { get { return tracking; } } ////// Tracesource for the host /// internal static TraceSource Host { get { return host; } } ////// Statically set up trace sources /// /// To enable logging to a file, add lines like the following to your app config file. /* static WorkflowTrace() { runtime = new TraceSource("System.Workflow.Runtime"); runtime.Switch = new SourceSwitch("System.Workflow.Runtime", SourceLevels.Off.ToString()); // we'll use ID of 1 for the scheduler, 0 for rest of runtime tracking = new TraceSource("System.Workflow.Runtime.Tracking"); tracking.Switch = new SourceSwitch("System.Workflow.Runtime.Tracking", SourceLevels.Off.ToString()); host = new TraceSource("System.Workflow.Runtime.Hosting"); host.Switch = new SourceSwitch("System.Workflow.Runtime.Hosting", SourceLevels.Off.ToString()); BooleanSwitch logToFile = new BooleanSwitch("System.Workflow LogToFile", "Log traces to file"); if (logToFile.Enabled) { TextWriterTraceListener fileLog = new TextWriterTraceListener("WorkflowTrace.log"); // add to global Listeners list Trace.Listeners.Add(fileLog); // don't add to tracking (which probably has its own log) runtime.Listeners.Add(fileLog); host.Listeners.Add(fileLog); } BooleanSwitch traceToDefault = new BooleanSwitch("System.Workflow LogToTraceListeners", "Trace to listeners in Trace.Listeners", "0"); if (traceToDefault.Enabled) { foreach (TraceListener listener in Trace.Listeners) { if (!(listener is DefaultTraceListener)) { runtime.Listeners.Add(listener); tracking.Listeners.Add(listener); host.Listeners.Add(listener); } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.*/ /// To enable tracing to default trace listeners, add lines like the following /* */ ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DownloadProgressEventArgs.cs
- safesecurityhelperavalon.cs
- ProfileBuildProvider.cs
- TTSVoice.cs
- DbProviderFactory.cs
- RoutingExtensionElement.cs
- ExpressionList.cs
- ChannelReliableSession.cs
- ActivityXamlServices.cs
- RepeatBehavior.cs
- Document.cs
- FlowDocumentScrollViewer.cs
- ConstraintStruct.cs
- BitmapPalette.cs
- SqlComparer.cs
- StopStoryboard.cs
- WebBrowsableAttribute.cs
- SoapSchemaExporter.cs
- DiscoveryEndpointElement.cs
- XmlQueryOutput.cs
- TypeConverterAttribute.cs
- CompilationSection.cs
- Component.cs
- ContentFileHelper.cs
- BroadcastEventHelper.cs
- Exceptions.cs
- ProcessThreadDesigner.cs
- ImageMapEventArgs.cs
- ExpressionBindingCollection.cs
- SqlRowUpdatedEvent.cs
- DrawingBrush.cs
- DbParameterCollectionHelper.cs
- DBCommandBuilder.cs
- MethodExpr.cs
- SupportsEventValidationAttribute.cs
- PerspectiveCamera.cs
- SqlDataSourceQueryConverter.cs
- PagesSection.cs
- NativeMethodsCLR.cs
- DiscoveryExceptionDictionary.cs
- UnSafeCharBuffer.cs
- tooltip.cs
- BaseDataList.cs
- Point3D.cs
- DiscoveryExceptionDictionary.cs
- InternalsVisibleToAttribute.cs
- SizeConverter.cs
- SingleResultAttribute.cs
- ManipulationCompletedEventArgs.cs
- PackageDigitalSignatureManager.cs
- ListViewItem.cs
- ObjectList.cs
- ScrollChrome.cs
- TextServicesCompartmentEventSink.cs
- XmlBinaryWriter.cs
- TextElementCollectionHelper.cs
- XPathMultyIterator.cs
- TaskFactory.cs
- XmlSchemaInferenceException.cs
- AssociationEndMember.cs
- ProfessionalColors.cs
- StoreConnection.cs
- HttpHandlerActionCollection.cs
- WebPartDescription.cs
- DataGridViewHitTestInfo.cs
- UrlMappingsModule.cs
- TextRangeEditTables.cs
- SafeProcessHandle.cs
- Certificate.cs
- TextUtf8RawTextWriter.cs
- RequestCacheManager.cs
- CodeDOMUtility.cs
- DataBoundControl.cs
- InnerItemCollectionView.cs
- AtomServiceDocumentSerializer.cs
- XamlHostingConfiguration.cs
- PropertyCollection.cs
- SQLSingle.cs
- GridEntryCollection.cs
- ToolStripItemImageRenderEventArgs.cs
- WpfGeneratedKnownTypes.cs
- TypeDescriptor.cs
- ExpressionPrinter.cs
- CurrentChangingEventManager.cs
- MSAAEventDispatcher.cs
- NetworkStream.cs
- SortedSetDebugView.cs
- FixedPageProcessor.cs
- MultipartContentParser.cs
- GeneralTransform2DTo3D.cs
- SymbolType.cs
- TextServicesManager.cs
- ObjectTokenCategory.cs
- SingleSelectRootGridEntry.cs
- PageOutputColor.cs
- AssemblyName.cs
- PartManifestEntry.cs
- XmlPropertyBag.cs
- TemplateEditingService.cs
- _NegotiateClient.cs