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
- ModelVisual3D.cs
- RemotingService.cs
- BookmarkScopeHandle.cs
- UIElementCollection.cs
- ZipIOExtraField.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- EdmToObjectNamespaceMap.cs
- ReadWriteSpinLock.cs
- ToolboxBitmapAttribute.cs
- ServicesUtilities.cs
- ExpressionCopier.cs
- FileNotFoundException.cs
- GeometryGroup.cs
- SqlRecordBuffer.cs
- XmlSchemaDocumentation.cs
- IsolatedStorage.cs
- SecurityElement.cs
- CallbackException.cs
- MetadataCache.cs
- ImpersonationContext.cs
- ExportOptions.cs
- StrokeNodeData.cs
- CharEnumerator.cs
- HttpApplicationFactory.cs
- ProfileParameter.cs
- GatewayIPAddressInformationCollection.cs
- NavigationProgressEventArgs.cs
- PageParser.cs
- FontWeights.cs
- UInt64Storage.cs
- SystemResourceKey.cs
- WebDisplayNameAttribute.cs
- COM2Enum.cs
- NamedObject.cs
- x509store.cs
- CapabilitiesUse.cs
- XmlElementList.cs
- ClientSettingsSection.cs
- Int32Rect.cs
- ActivityCodeDomSerializationManager.cs
- XmlNode.cs
- Ray3DHitTestResult.cs
- RawStylusInput.cs
- Set.cs
- EventHandlersStore.cs
- PostBackTrigger.cs
- OrderedHashRepartitionEnumerator.cs
- Registry.cs
- InkCanvas.cs
- BitmapVisualManager.cs
- DataControlCommands.cs
- XPathQueryGenerator.cs
- WebPartCloseVerb.cs
- MetadataArtifactLoaderCompositeResource.cs
- XamlPathDataSerializer.cs
- SqlExpander.cs
- HealthMonitoringSection.cs
- AssemblyName.cs
- QuestionEventArgs.cs
- ObjectSet.cs
- WindowsTab.cs
- PeerTransportListenAddressConverter.cs
- httpstaticobjectscollection.cs
- TextRange.cs
- PermissionListSet.cs
- SystemTcpConnection.cs
- LeftCellWrapper.cs
- FormsAuthenticationCredentials.cs
- UIElement3D.cs
- ImageConverter.cs
- Page.cs
- ObjectMaterializedEventArgs.cs
- SelectionItemPattern.cs
- GridViewRowEventArgs.cs
- XmlCodeExporter.cs
- ValidatingReaderNodeData.cs
- FileDialog.cs
- DataGridViewHeaderCell.cs
- path.cs
- COM2PropertyPageUITypeConverter.cs
- SafeRightsManagementPubHandle.cs
- TreeViewHitTestInfo.cs
- Pen.cs
- XmlSchemaAttribute.cs
- EntityViewContainer.cs
- SchemaTypeEmitter.cs
- RootBuilder.cs
- OleDbReferenceCollection.cs
- BasicCellRelation.cs
- SafeCryptContextHandle.cs
- ChangeNode.cs
- BindingManagerDataErrorEventArgs.cs
- UnknownWrapper.cs
- TextTreeTextBlock.cs
- SerializationEventsCache.cs
- DbConnectionPoolGroupProviderInfo.cs
- PropertyRecord.cs
- GrabHandleGlyph.cs
- DataControlPagerLinkButton.cs
- versioninfo.cs