Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Log / System / IO / Log / FileLogRecordHeader.cs / 1305376 / FileLogRecordHeader.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IO.Log { using System.IO; using System.Diagnostics; internal struct FileLogRecordHeader { [Flags] enum LowFlags : byte { RestartArea = 0x01 } internal const int Size = 20; internal const byte MAJORVER = 1; internal const byte MINORVER = 0; const int MajorVersionOffset = 0; const int MinorVersionOffset = 1; const int LowFlagsOffset = 2; const int HighFlagsOffset = 3; const int PreviousLsnOffsetHigh = 4; const int NextUndoLsnOffsetHigh = 12; byte[] bits; internal FileLogRecordHeader(byte[] bits) { if (bits == null) { this.bits = new Byte[Size]; this.bits[MajorVersionOffset] = MAJORVER; this.bits[MinorVersionOffset] = MINORVER; } else { if (bits.Length < Size) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.LogCorrupt()); } // if version not supported then ??? if (bits[MajorVersionOffset] != MAJORVER) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.IncompatibleVersion()); this.bits = bits; } } internal bool IsRestartArea { get { return (((LowFlags)bits[LowFlagsOffset] & LowFlags.RestartArea) != 0); } set { LowFlags flags = (LowFlags)bits[LowFlagsOffset]; if (value) flags |= LowFlags.RestartArea; else flags &= ~LowFlags.RestartArea; bits[LowFlagsOffset] = (byte)(flags); } } internal SequenceNumber PreviousLsn { get { return new SequenceNumber( BitConverter.ToUInt64(this.bits, PreviousLsnOffsetHigh)); } set { SequenceNumber.WriteUInt64(value.High, this.bits, PreviousLsnOffsetHigh); } } internal SequenceNumber NextUndoLsn { get { return new SequenceNumber(BitConverter.ToUInt64(this.bits, NextUndoLsnOffsetHigh)); } set { SequenceNumber.WriteUInt64(value.High, this.bits, NextUndoLsnOffsetHigh); } } internal byte[] Bits { get { return this.bits; } } } } // 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
- TextTreeRootTextBlock.cs
- RecipientInfo.cs
- DetailsViewUpdatedEventArgs.cs
- DataGridCell.cs
- PropertyItemInternal.cs
- PathNode.cs
- sqlpipe.cs
- ProviderException.cs
- BaseCodeDomTreeGenerator.cs
- WrappingXamlSchemaContext.cs
- PingOptions.cs
- ValidateNames.cs
- ImageMapEventArgs.cs
- XmlSchemaResource.cs
- ConfigurationValues.cs
- XslCompiledTransform.cs
- DrawTreeNodeEventArgs.cs
- InvalidOperationException.cs
- Exceptions.cs
- TableLayout.cs
- XmlWhitespace.cs
- PackageRelationshipCollection.cs
- IProducerConsumerCollection.cs
- ArrayElementGridEntry.cs
- Rect3DConverter.cs
- PackageDocument.cs
- TextWriter.cs
- ProviderConnectionPointCollection.cs
- TextEditorSpelling.cs
- PocoEntityKeyStrategy.cs
- ConfigurationValidatorBase.cs
- PrtCap_Reader.cs
- Path.cs
- Win32Native.cs
- Baml2006ReaderFrame.cs
- ListCardsInFileRequest.cs
- SocketManager.cs
- HandlerFactoryWrapper.cs
- UserControl.cs
- XPathNavigator.cs
- AnnotationResource.cs
- ComponentChangedEvent.cs
- DictionaryChange.cs
- TraceHwndHost.cs
- StrongNamePublicKeyBlob.cs
- BamlReader.cs
- PublisherIdentityPermission.cs
- RemoteWebConfigurationHost.cs
- followingsibling.cs
- DetailsViewRowCollection.cs
- WindowsIdentity.cs
- ManagementEventWatcher.cs
- DocumentReferenceCollection.cs
- WindowsListViewItemCheckBox.cs
- ArrayTypeMismatchException.cs
- AtomicFile.cs
- InvalidChannelBindingException.cs
- SQLDouble.cs
- DispatcherExceptionEventArgs.cs
- IListConverters.cs
- DockingAttribute.cs
- HttpHeaderCollection.cs
- util.cs
- DashStyles.cs
- OdbcEnvironment.cs
- InkSerializer.cs
- ImageListStreamer.cs
- OracleConnectionFactory.cs
- MemberBinding.cs
- MarginsConverter.cs
- IPEndPointCollection.cs
- SqlVisitor.cs
- AttachmentCollection.cs
- TcpServerChannel.cs
- _Events.cs
- ParseChildrenAsPropertiesAttribute.cs
- MergePropertyDescriptor.cs
- PolicyLevel.cs
- ByteStreamGeometryContext.cs
- EasingQuaternionKeyFrame.cs
- ProviderBase.cs
- RecordsAffectedEventArgs.cs
- XhtmlBasicValidationSummaryAdapter.cs
- JsonReaderDelegator.cs
- ProcessMessagesAsyncResult.cs
- ProfileParameter.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- FileDialog_Vista_Interop.cs
- PeerInvitationResponse.cs
- ComponentDispatcherThread.cs
- CheckBoxList.cs
- SchemaNames.cs
- Table.cs
- ActivityCodeDomSerializer.cs
- XmlAnyElementAttribute.cs
- ListSourceHelper.cs
- _ProxyRegBlob.cs
- WindowsEditBoxRange.cs
- ViewUtilities.cs
- PathSegmentCollection.cs