Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Diagnostics / Managed / Microsoft / InfoCards / Diagnostics / InfoCardTraceRecord.cs / 1305376 / InfoCardTraceRecord.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace Microsoft.InfoCards.Diagnostics
{
using System;
using System.Xml;
using System.Diagnostics;
//
// Summary
// An InfoCardTraceRecord represents an ETW tracerecord plus some infocard specific
// schema information. The class is called back by the diagnostics infrastructure through
// its WriteTo() method in order to serialize the infocard specific contents into the traceRecord structure.
// as part of a tracing request. the TraceRecord base class is repsonsible for embedding the correct headers etc.
//
// Trace records look like this:
//
//
// StoreSignatureCollision
// rabbits
// http://schemas.microsoft.com/2004/03/System/AppDomain/{2bd64add-212d-4385-9f8e-6d9ab976c182}
//
// rabbit%s
//
//
//
class InfoCardTraceRecord : System.Runtime.Diagnostics.TraceRecord
{
//
// The eventID, a string representation of the traceCode. Normally something like
// 'StoreSignatureCollision' - used to derive the trace uri.
//
private string m_eventID;
//
// A descriptive message about the error schematized as xmlAny
//
private string m_message;
const string InfoCardEventIdBase = "http://schemas.microsoft.com/2004/11/InfoCard/";
public InfoCardTraceRecord( string eventID, string message )
{
InfoCardTrace.Assert( !String.IsNullOrEmpty( eventID ), "null eventid" );
InfoCardTrace.Assert( !String.IsNullOrEmpty( message ), "null message" );
m_eventID = eventID;
m_message = message;
}
//
// Summary:
// Returns the unique identifier for this event. Represented as a uri under the stanard e2e logging
// schema - configured as + +
// for example
// "http://schemas.microsoft.com/2004/11/InfoCard/" + "StoreSignatureCollision" + TraceRecord
//
internal override string EventId
{
get
{
return InfoCardEventIdBase + m_eventID + System.Runtime.Diagnostics.TraceRecord.NamespaceSuffix;
}
}
//
// Summary:
// Called back by the indigo diagnostic trace infrastructure during etw trace logging.
// Writes the extendedData section out to the TraceRecord.
//
//
internal override void WriteTo( XmlWriter writer )
{
InfoCardTrace.Assert( null != writer, "null writer" );
writer.WriteElementString( "message", m_message );
}
//
// Override tostring to give a better event logging experience.
//
public override string ToString()
{
return SR.GetString( SR.EventLogMessage, m_eventID, m_message );
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace Microsoft.InfoCards.Diagnostics
{
using System;
using System.Xml;
using System.Diagnostics;
//
// Summary
// An InfoCardTraceRecord represents an ETW tracerecord plus some infocard specific
// schema information. The class is called back by the diagnostics infrastructure through
// its WriteTo() method in order to serialize the infocard specific contents into the traceRecord structure.
// as part of a tracing request. the TraceRecord base class is repsonsible for embedding the correct headers etc.
//
// Trace records look like this:
//
//
// StoreSignatureCollision
// rabbits
// http://schemas.microsoft.com/2004/03/System/AppDomain/{2bd64add-212d-4385-9f8e-6d9ab976c182}
//
// rabbit%s
//
//
//
class InfoCardTraceRecord : System.Runtime.Diagnostics.TraceRecord
{
//
// The eventID, a string representation of the traceCode. Normally something like
// 'StoreSignatureCollision' - used to derive the trace uri.
//
private string m_eventID;
//
// A descriptive message about the error schematized as xmlAny
//
private string m_message;
const string InfoCardEventIdBase = "http://schemas.microsoft.com/2004/11/InfoCard/";
public InfoCardTraceRecord( string eventID, string message )
{
InfoCardTrace.Assert( !String.IsNullOrEmpty( eventID ), "null eventid" );
InfoCardTrace.Assert( !String.IsNullOrEmpty( message ), "null message" );
m_eventID = eventID;
m_message = message;
}
//
// Summary:
// Returns the unique identifier for this event. Represented as a uri under the stanard e2e logging
// schema - configured as + +
// for example
// "http://schemas.microsoft.com/2004/11/InfoCard/" + "StoreSignatureCollision" + TraceRecord
//
internal override string EventId
{
get
{
return InfoCardEventIdBase + m_eventID + System.Runtime.Diagnostics.TraceRecord.NamespaceSuffix;
}
}
//
// Summary:
// Called back by the indigo diagnostic trace infrastructure during etw trace logging.
// Writes the extendedData section out to the TraceRecord.
//
//
internal override void WriteTo( XmlWriter writer )
{
InfoCardTrace.Assert( null != writer, "null writer" );
writer.WriteElementString( "message", m_message );
}
//
// Override tostring to give a better event logging experience.
//
public override string ToString()
{
return SR.GetString( SR.EventLogMessage, m_eventID, m_message );
}
}
}
// 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
- WebPartCatalogCloseVerb.cs
- BrushMappingModeValidation.cs
- NetworkInformationPermission.cs
- NullableIntAverageAggregationOperator.cs
- TransformCollection.cs
- CanonicalXml.cs
- KeyboardEventArgs.cs
- ServerReliableChannelBinder.cs
- EntityDesignerUtils.cs
- CellRelation.cs
- WeakRefEnumerator.cs
- SortQueryOperator.cs
- ExpressionBuilder.cs
- VirtualizingPanel.cs
- WindowShowOrOpenTracker.cs
- ServiceReference.cs
- DataGridViewCellEventArgs.cs
- ActiveXHost.cs
- InplaceBitmapMetadataWriter.cs
- DefaultBindingPropertyAttribute.cs
- AttachInfo.cs
- TextTreeText.cs
- KeyInterop.cs
- HttpGetServerProtocol.cs
- ObjectStateManagerMetadata.cs
- WindowsTitleBar.cs
- TagPrefixCollection.cs
- LassoHelper.cs
- _UriSyntax.cs
- DateTimeHelper.cs
- StaticDataManager.cs
- AutomationPatternInfo.cs
- HostedHttpRequestAsyncResult.cs
- CheckBoxList.cs
- ReflectionPermission.cs
- FlowDocumentPageViewerAutomationPeer.cs
- TableAdapterManagerNameHandler.cs
- TextMarkerSource.cs
- KeyboardNavigation.cs
- SelectionRange.cs
- TrimSurroundingWhitespaceAttribute.cs
- PolicyChain.cs
- EnumerableValidator.cs
- GridViewDeleteEventArgs.cs
- ToolStripArrowRenderEventArgs.cs
- FlatButtonAppearance.cs
- WindowsFormsSectionHandler.cs
- SqlDataSourceConnectionPanel.cs
- ActivityWithResultConverter.cs
- Function.cs
- BinaryFormatterWriter.cs
- CanonicalFontFamilyReference.cs
- WebBrowserNavigatingEventHandler.cs
- RangeValuePatternIdentifiers.cs
- VirtualDirectoryMapping.cs
- ApplicationFileCodeDomTreeGenerator.cs
- Odbc32.cs
- DataKey.cs
- SystemWebSectionGroup.cs
- smtppermission.cs
- LoginView.cs
- WriteStateInfoBase.cs
- ConfigurationSettings.cs
- URLMembershipCondition.cs
- JobInputBins.cs
- HotCommands.cs
- ViewStateChangedEventArgs.cs
- LiteralControl.cs
- CodeComment.cs
- CalendarDayButton.cs
- StreamAsIStream.cs
- LocalizabilityAttribute.cs
- SR.cs
- ForwardPositionQuery.cs
- TextLineResult.cs
- LocalFileSettingsProvider.cs
- InputBindingCollection.cs
- TranslateTransform.cs
- Clock.cs
- HostingEnvironment.cs
- XPathParser.cs
- SecurityTokenContainer.cs
- DataSourceControl.cs
- QuaternionRotation3D.cs
- WebPartConnectionsCloseVerb.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- CodeCompileUnit.cs
- TextDocumentView.cs
- GetKeyedHashRequest.cs
- XmlSerializerObjectSerializer.cs
- XmlNodeReader.cs
- DataMemberListEditor.cs
- HttpErrorTraceRecord.cs
- FormViewCommandEventArgs.cs
- SqlNamer.cs
- D3DImage.cs
- Converter.cs
- CancelEventArgs.cs
- ValueConversionAttribute.cs
- FormViewUpdatedEventArgs.cs