Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / Serialization / Formatters / SerTrace.cs / 1305376 / SerTrace.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Class: SerTrace
**
**
** Purpose: Routine used for Debugging
**
**
===========================================================*/
namespace System.Runtime.Serialization.Formatters {
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Reflection;
using System.Diagnostics;
using System.Diagnostics.Contracts;
#if FEATURE_PAL
// To turn on tracing, add the following to the per-machine
// rotor.ini file, inside the [Rotor] section:
// ManagedLogFacility=0x32
// where:
#else
// To turn on tracing the set registry
// HKEY_CURRENT_USER -> Software -> Microsoft -> .NETFramework
// new DWORD value ManagedLogFacility 0x32 where
#endif
// 0x2 is System.Runtime.Serialization
// 0x10 is Binary Formatter
// 0x20 is Soap Formatter
//
// Turn on Logging in the jitmgr
// remoting Wsdl logging
///
[System.Security.SecurityCritical] // auto-generated_required
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class InternalRM
{
///
[System.Diagnostics.Conditional("_LOGGING")]
public static void InfoSoap(params Object[]messages)
{
BCLDebug.Trace("SOAP", messages);
}
//[System.Diagnostics.Conditional("_LOGGING")]
///
public static bool SoapCheckEnabled()
{
return BCLDebug.CheckEnabled("SOAP");
}
}
///
[System.Security.SecurityCritical] // auto-generated_required
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class InternalST
{
private InternalST()
{
}
///
[System.Diagnostics.Conditional("_LOGGING")]
public static void InfoSoap(params Object[]messages)
{
BCLDebug.Trace("SOAP", messages);
}
//[System.Diagnostics.Conditional("_LOGGING")]
///
public static bool SoapCheckEnabled()
{
return BCLDebug.CheckEnabled("Soap");
}
///
[System.Diagnostics.Conditional("SER_LOGGING")]
public static void Soap(params Object[]messages)
{
if (!(messages[0] is String))
messages[0] = (messages[0].GetType()).Name+" ";
else
messages[0] = messages[0]+" ";
BCLDebug.Trace("SOAP",messages);
}
///
[System.Diagnostics.Conditional("_DEBUG")]
public static void SoapAssert(bool condition, String message)
{
Contract.Assert(condition, message);
}
///
public static void SerializationSetValue(FieldInfo fi, Object target, Object value)
{
if (fi == null)
throw new ArgumentNullException("fi");
if (target == null)
throw new ArgumentNullException("target");
if (value == null)
throw new ArgumentNullException("value");
Contract.EndContractBlock();
FormatterServices.SerializationSetValue(fi, target, value);
}
///
public static Assembly LoadAssemblyFromString(String assemblyString)
{
return FormatterServices.LoadAssemblyFromString(assemblyString);
}
}
internal static class SerTrace
{
[Conditional("_LOGGING")]
internal static void InfoLog(params Object[]messages)
{
BCLDebug.Trace("BINARY", messages);
}
[Conditional("SER_LOGGING")]
internal static void Log(params Object[]messages)
{
if (!(messages[0] is String))
messages[0] = (messages[0].GetType()).Name+" ";
else
messages[0] = messages[0]+" ";
BCLDebug.Trace("BINARY",messages);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpException.cs
- DockPatternIdentifiers.cs
- SmtpLoginAuthenticationModule.cs
- XmlStreamNodeWriter.cs
- DrawingCollection.cs
- ColumnBinding.cs
- ColumnTypeConverter.cs
- XmlTextWriter.cs
- mediapermission.cs
- TabRenderer.cs
- ExtractedStateEntry.cs
- ProfileParameter.cs
- StorageEntityContainerMapping.cs
- PropertyChangedEventArgs.cs
- ObjectToken.cs
- Bits.cs
- LabelLiteral.cs
- ClientBuildManager.cs
- SqlWebEventProvider.cs
- OpCodes.cs
- CommandField.cs
- securestring.cs
- AttributeData.cs
- EdmProperty.cs
- FrameworkContentElementAutomationPeer.cs
- XmlReflectionImporter.cs
- CommittableTransaction.cs
- WindowsTab.cs
- ForwardPositionQuery.cs
- InvalidCastException.cs
- PathFigureCollectionConverter.cs
- HtmlHead.cs
- NumberSubstitution.cs
- RuleDefinitions.cs
- ImagingCache.cs
- ADMembershipProvider.cs
- SoapFormatterSinks.cs
- XmlWrappingWriter.cs
- CodeIdentifiers.cs
- CodeNamespaceImportCollection.cs
- BuilderInfo.cs
- ManifestResourceInfo.cs
- SqlDelegatedTransaction.cs
- MultiPageTextView.cs
- ResourceContainer.cs
- TdsParameterSetter.cs
- MultiView.cs
- Rectangle.cs
- Int16Animation.cs
- IFlowDocumentViewer.cs
- EncryptedKey.cs
- ManipulationDeltaEventArgs.cs
- XamlFigureLengthSerializer.cs
- QuestionEventArgs.cs
- SortedList.cs
- BindingContext.cs
- AnnotationResourceCollection.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- GridProviderWrapper.cs
- Model3DGroup.cs
- RawStylusInputReport.cs
- SiteIdentityPermission.cs
- LineServicesCallbacks.cs
- OracleBoolean.cs
- XmlSchemaNotation.cs
- InvalidOperationException.cs
- ZipPackagePart.cs
- CorrelationValidator.cs
- DataAccessor.cs
- CodeAccessPermission.cs
- StringFreezingAttribute.cs
- ElementFactory.cs
- BindingCompleteEventArgs.cs
- x509store.cs
- RequestQueue.cs
- SerializationEventsCache.cs
- DesignerProperties.cs
- HttpDictionary.cs
- UnsafeMethods.cs
- ColorBlend.cs
- DrawingContextDrawingContextWalker.cs
- CollectionMarkupSerializer.cs
- XmlLanguage.cs
- RemoteWebConfigurationHost.cs
- DataGridRowHeaderAutomationPeer.cs
- HighlightVisual.cs
- ContextDataSourceContextData.cs
- SiteMapHierarchicalDataSourceView.cs
- BitmapCacheBrush.cs
- EncryptedHeader.cs
- SrgsToken.cs
- ImageSource.cs
- GroupBoxDesigner.cs
- PipeStream.cs
- ToolConsole.cs
- FindCriteriaApril2005.cs
- ScriptResourceAttribute.cs
- CollectionContainer.cs
- TypeConverters.cs
- FixedHighlight.cs