Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / TransactionBridge / Microsoft / Transactions / Wsat / Recovery / LogEntryHeaderSerializer.cs / 1 / LogEntryHeaderSerializer.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // This file contains the knowledge of how to serialize a log entry header // in the current format using System; using System.IO; using Microsoft.Transactions.Wsat.InputOutput; using Microsoft.Transactions.Wsat.Messaging; namespace Microsoft.Transactions.Wsat.Recovery { enum LogEntryHeaderVersion : byte { v1 = 1, } [Flags] enum LogEntryHeaderv1Flags : byte { StandardRemoteTransactionId = 0x01, } class LogEntryHeaderSerializer { LogEntry logEntry; public LogEntryHeaderSerializer(LogEntry logEntry) { this.logEntry = logEntry; } public MemoryStream WriteHeader() { MemoryStream mem = new MemoryStream(); // Versions mem.WriteByte((byte) LogEntryHeaderVersion.v1); // Flags and remote transaction Id if (CoordinationContext.IsNativeIdentifier(logEntry.RemoteTransactionId, logEntry.LocalTransactionId)) { mem.WriteByte((byte) LogEntryHeaderv1Flags.StandardRemoteTransactionId); } else { mem.WriteByte(0); SerializationUtils.WriteString(mem, logEntry.RemoteTransactionId); } // Local enlistmentId Guid localEnlistmentId = logEntry.LocalEnlistmentId; SerializationUtils.WriteGuid(mem, ref localEnlistmentId); return mem; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AsyncPostBackTrigger.cs
- DataTemplate.cs
- CategoryGridEntry.cs
- LocationUpdates.cs
- TextLine.cs
- ThumbAutomationPeer.cs
- Delegate.cs
- EntityParameterCollection.cs
- HashHelper.cs
- TextBoxAutomationPeer.cs
- UserMapPath.cs
- ScriptReferenceBase.cs
- CounterCreationDataCollection.cs
- ImmutableCollection.cs
- DataGridViewCellPaintingEventArgs.cs
- RtfNavigator.cs
- InputBindingCollection.cs
- AddInBase.cs
- RadioButtonDesigner.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- CellTreeNode.cs
- ObsoleteAttribute.cs
- Int16AnimationUsingKeyFrames.cs
- TypeUtil.cs
- QueryOutputWriterV1.cs
- WeakReferenceKey.cs
- TdsEnums.cs
- ToolStripControlHost.cs
- FontDifferentiator.cs
- AsyncStreamReader.cs
- TableItemStyle.cs
- InternalControlCollection.cs
- BoundPropertyEntry.cs
- HeaderCollection.cs
- PropertyConverter.cs
- SoapAttributeOverrides.cs
- DynamicPropertyHolder.cs
- DeploymentSectionCache.cs
- PublishLicense.cs
- CircleHotSpot.cs
- FactoryGenerator.cs
- HMACSHA384.cs
- Mappings.cs
- CapiNative.cs
- WinEventWrap.cs
- XsltInput.cs
- FontSizeConverter.cs
- HttpFileCollection.cs
- ActivityInstanceReference.cs
- AsynchronousChannel.cs
- ConstructorExpr.cs
- precedingquery.cs
- LinkConverter.cs
- GenericRootAutomationPeer.cs
- InvokeBinder.cs
- DecimalAnimation.cs
- ClientOptions.cs
- Expander.cs
- DefaultPrintController.cs
- DBSqlParserColumn.cs
- XmlKeywords.cs
- ChangePassword.cs
- XhtmlBasicPanelAdapter.cs
- CriticalFinalizerObject.cs
- RegexInterpreter.cs
- DataConnectionHelper.cs
- Renderer.cs
- RegexCompiler.cs
- XPathNavigatorKeyComparer.cs
- ControlAdapter.cs
- GCHandleCookieTable.cs
- MessageSecurityProtocol.cs
- OleDbCommandBuilder.cs
- Globals.cs
- DesignRelation.cs
- AnnouncementEndpointElement.cs
- LambdaExpression.cs
- DbProviderServices.cs
- AssemblyCollection.cs
- MenuAdapter.cs
- DataListCommandEventArgs.cs
- ApplicationBuildProvider.cs
- ActivityDesignerResources.cs
- SplineKeyFrames.cs
- ItemsChangedEventArgs.cs
- ErrorProvider.cs
- AcceleratedTokenAuthenticator.cs
- DbConnectionFactory.cs
- CatchDesigner.xaml.cs
- TCPClient.cs
- KeySpline.cs
- PointF.cs
- BamlLocalizableResourceKey.cs
- StateItem.cs
- AxDesigner.cs
- TextDecorationUnitValidation.cs
- GreenMethods.cs
- WorkflowViewStateService.cs
- BindingsCollection.cs
- rsa.cs