Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Log / System / IO / Log / FileLogRecordHeader.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RpcAsyncResult.cs
- SystemIPInterfaceStatistics.cs
- XMLDiffLoader.cs
- DataGridViewCell.cs
- XmlJsonReader.cs
- FtpCachePolicyElement.cs
- ContentControl.cs
- DbProviderFactory.cs
- ListViewDeletedEventArgs.cs
- FormatterConverter.cs
- DataGridViewAddColumnDialog.cs
- EffectiveValueEntry.cs
- DayRenderEvent.cs
- RootBrowserWindowAutomationPeer.cs
- TextPatternIdentifiers.cs
- EditorZoneDesigner.cs
- DataGridCellsPanel.cs
- DayRenderEvent.cs
- AsymmetricKeyExchangeFormatter.cs
- TypeForwardedToAttribute.cs
- NamedPipeAppDomainProtocolHandler.cs
- StructuredType.cs
- MiniConstructorInfo.cs
- XmlLinkedNode.cs
- ValidationErrorEventArgs.cs
- RewritingValidator.cs
- AuthenticateEventArgs.cs
- RoleManagerSection.cs
- StreamHelper.cs
- WSTrust.cs
- ServiceMetadataPublishingElement.cs
- Base64Decoder.cs
- TargetException.cs
- ToolTipAutomationPeer.cs
- XmlSecureResolver.cs
- NegotiateStream.cs
- AuthenticationConfig.cs
- XhtmlBasicLabelAdapter.cs
- ArcSegment.cs
- UInt64Converter.cs
- DataGridBoolColumn.cs
- HtmlUtf8RawTextWriter.cs
- KeyboardDevice.cs
- Soap12ServerProtocol.cs
- SizeChangedEventArgs.cs
- TdsRecordBufferSetter.cs
- ManagementPath.cs
- KnownColorTable.cs
- IndentedWriter.cs
- RangeExpression.cs
- DynamicPropertyReader.cs
- IsolationInterop.cs
- DiscoveryDocumentSerializer.cs
- SingleSelectRootGridEntry.cs
- DependencyPropertyChangedEventArgs.cs
- Instrumentation.cs
- GeometryDrawing.cs
- ObjectListCommandEventArgs.cs
- StateMachineHelpers.cs
- ValueProviderWrapper.cs
- TextContainerHelper.cs
- ConsoleKeyInfo.cs
- CommonServiceBehaviorElement.cs
- WebControlsSection.cs
- FixedSOMTableCell.cs
- QuaternionKeyFrameCollection.cs
- OdbcConnectionString.cs
- DebugInfoGenerator.cs
- FragmentQueryProcessor.cs
- OutKeywords.cs
- EntityContainerAssociationSetEnd.cs
- QuerySettings.cs
- ApplicationHost.cs
- ByteStream.cs
- TreeViewBindingsEditorForm.cs
- ClientRuntimeConfig.cs
- Base64Encoder.cs
- DesigntimeLicenseContext.cs
- Globals.cs
- SwitchAttribute.cs
- ObjectSecurity.cs
- ValueProviderWrapper.cs
- SchemaCompiler.cs
- FormsAuthenticationTicket.cs
- EastAsianLunisolarCalendar.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- HttpResponseMessageProperty.cs
- DbModificationCommandTree.cs
- Timer.cs
- HostProtectionException.cs
- Triangle.cs
- WeakKeyDictionary.cs
- CompilerGeneratedAttribute.cs
- OpacityConverter.cs
- DiscoveryProxy.cs
- ViewBox.cs
- DbConnectionPoolGroupProviderInfo.cs
- TimeSpanOrInfiniteValidator.cs
- SessionPageStatePersister.cs
- DataGridTextBox.cs