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
- StickyNoteHelper.cs
- TextTreeRootNode.cs
- handlecollector.cs
- MailDefinition.cs
- OracleCommandSet.cs
- ReferenceConverter.cs
- WebBrowserNavigatingEventHandler.cs
- XmlEntity.cs
- ObjectCloneHelper.cs
- Automation.cs
- TextModifierScope.cs
- ManagementPath.cs
- CodeNamespaceImport.cs
- Int32CAMarshaler.cs
- MessageAction.cs
- BufferAllocator.cs
- BooleanExpr.cs
- SamlAudienceRestrictionCondition.cs
- Rect3DValueSerializer.cs
- GACMembershipCondition.cs
- DeobfuscatingStream.cs
- DataIdProcessor.cs
- ProfileGroupSettings.cs
- PolicyImporterElementCollection.cs
- SelectionWordBreaker.cs
- TextMarkerSource.cs
- UserControlBuildProvider.cs
- WindowsNonControl.cs
- StringInfo.cs
- ColorMatrix.cs
- HtmlInputReset.cs
- EntityDataSourceChangingEventArgs.cs
- FloaterBaseParaClient.cs
- CompilationUnit.cs
- PolicyUtility.cs
- StatusBarItem.cs
- NetStream.cs
- SendReply.cs
- TimeManager.cs
- RSACryptoServiceProvider.cs
- WSSecureConversationDec2005.cs
- BufferModesCollection.cs
- EpmContentSerializerBase.cs
- SvcMapFileSerializer.cs
- ContentTypeSettingDispatchMessageFormatter.cs
- UniformGrid.cs
- FilterableAttribute.cs
- MobileControlsSection.cs
- DataObjectAttribute.cs
- DataSvcMapFileSerializer.cs
- DoubleLink.cs
- XmlSchemaIdentityConstraint.cs
- LocalizabilityAttribute.cs
- DataGridViewComboBoxCell.cs
- OdbcConnectionOpen.cs
- ZoneMembershipCondition.cs
- SchemaElementLookUpTable.cs
- TextBounds.cs
- InputScopeManager.cs
- MeasureItemEvent.cs
- SelectionGlyphBase.cs
- DetailsViewCommandEventArgs.cs
- ProxyDataContractResolver.cs
- DataBindingHandlerAttribute.cs
- WebPartManagerInternals.cs
- TextPointerBase.cs
- TemplateControlBuildProvider.cs
- TimelineClockCollection.cs
- HttpListenerResponse.cs
- _AuthenticationState.cs
- WebPartMinimizeVerb.cs
- CodeDefaultValueExpression.cs
- RequiredFieldValidator.cs
- CursorConverter.cs
- TableParagraph.cs
- SystemThemeKey.cs
- Preprocessor.cs
- PixelFormat.cs
- IssuedTokenClientElement.cs
- DiffuseMaterial.cs
- ProcessingInstructionAction.cs
- TrailingSpaceComparer.cs
- XmlSchemaAppInfo.cs
- ResourceReader.cs
- CollectionConverter.cs
- NetTcpSection.cs
- AutomationElementCollection.cs
- BitConverter.cs
- ReadOnlyDictionary.cs
- CDSsyncETWBCLProvider.cs
- PtsHost.cs
- ProcessHostFactoryHelper.cs
- AttachedPropertyMethodSelector.cs
- FontSource.cs
- BitStack.cs
- TypeReference.cs
- WebUtil.cs
- PasswordPropertyTextAttribute.cs
- ObjectTypeMapping.cs
- XmlSchemaAnyAttribute.cs