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
- WebPartEditVerb.cs
- SqlUtil.cs
- TextRange.cs
- ProtocolElementCollection.cs
- StorageScalarPropertyMapping.cs
- X509Certificate2Collection.cs
- PropertyGroupDescription.cs
- ReceiveSecurityHeader.cs
- AutomationAttributeInfo.cs
- DescriptionAttribute.cs
- SolidColorBrush.cs
- XmlCharCheckingWriter.cs
- AccessText.cs
- WebPartConnection.cs
- InputBinder.cs
- HasCopySemanticsAttribute.cs
- WebPartVerbCollection.cs
- DllNotFoundException.cs
- URLString.cs
- SoapSchemaImporter.cs
- TextDecorationCollection.cs
- InputBuffer.cs
- ParameterCollection.cs
- IResourceProvider.cs
- PopOutPanel.cs
- XPathChildIterator.cs
- XmlWriterDelegator.cs
- ControlBuilder.cs
- CopyOnWriteList.cs
- ColorAnimationUsingKeyFrames.cs
- SignatureResourcePool.cs
- ExpressionValueEditor.cs
- TransformGroup.cs
- IndexOutOfRangeException.cs
- SimpleType.cs
- HttpDebugHandler.cs
- XmlQualifiedName.cs
- HandleCollector.cs
- StrokeNodeOperations.cs
- WindowsFormsSynchronizationContext.cs
- DataGridState.cs
- DrawingAttributeSerializer.cs
- DataControlPagerLinkButton.cs
- FormatterServices.cs
- QilSortKey.cs
- XmlSchemaType.cs
- AssemblyInfo.cs
- ListViewGroupConverter.cs
- Size.cs
- StickyNoteHelper.cs
- HostingPreferredMapPath.cs
- EdmComplexPropertyAttribute.cs
- ExpandedProjectionNode.cs
- SqlCacheDependencyDatabaseCollection.cs
- MultitargetingHelpers.cs
- ThreadLocal.cs
- ImageListImageEditor.cs
- Int32Rect.cs
- ConfigurationSection.cs
- JsonReader.cs
- WebPartDisplayModeEventArgs.cs
- LinearQuaternionKeyFrame.cs
- NavigationPropertyEmitter.cs
- SecurityContextSecurityTokenResolver.cs
- FileDialogCustomPlaces.cs
- DeploymentSectionCache.cs
- CharStorage.cs
- DataServiceConfiguration.cs
- Ops.cs
- BadImageFormatException.cs
- SiteMapNodeCollection.cs
- HttpStreamXmlDictionaryReader.cs
- FileChangesMonitor.cs
- ScriptingWebServicesSectionGroup.cs
- ConnectionInterfaceCollection.cs
- ProviderConnectionPointCollection.cs
- TCEAdapterGenerator.cs
- DuplicateWaitObjectException.cs
- KeyManager.cs
- ItemChangedEventArgs.cs
- WebPartDescriptionCollection.cs
- CompilerErrorCollection.cs
- EntityDataSourceValidationException.cs
- ProviderMetadataCachedInformation.cs
- Cast.cs
- BaseCollection.cs
- FieldAccessException.cs
- HtmlImage.cs
- ProcessHostMapPath.cs
- SynchronizedPool.cs
- ConfigurationStrings.cs
- GetParentChain.cs
- BreadCrumbTextConverter.cs
- RemotingException.cs
- Byte.cs
- SegmentTree.cs
- RegexCode.cs
- _TLSstream.cs
- TextureBrush.cs
- OuterGlowBitmapEffect.cs