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
- SqlDataSourceSelectingEventArgs.cs
- NullableDecimalMinMaxAggregationOperator.cs
- ParamArrayAttribute.cs
- httpapplicationstate.cs
- TextEditorSelection.cs
- DataTableClearEvent.cs
- ImageAttributes.cs
- WorkflowWebService.cs
- ConnectionStringsExpressionEditor.cs
- StylusTip.cs
- DataGridCheckBoxColumn.cs
- SHA1.cs
- httpserverutility.cs
- MonikerHelper.cs
- LowerCaseStringConverter.cs
- EFAssociationProvider.cs
- ObjectDisposedException.cs
- XmlAttributes.cs
- PackagePartCollection.cs
- XmlIlVisitor.cs
- PEFileReader.cs
- LineProperties.cs
- SpellerStatusTable.cs
- CoTaskMemHandle.cs
- WindowInteropHelper.cs
- ResourceCategoryAttribute.cs
- CodeSnippetTypeMember.cs
- ApplyTemplatesAction.cs
- DESCryptoServiceProvider.cs
- BaseAddressPrefixFilterElement.cs
- NetTcpSecurity.cs
- SerialStream.cs
- TrackPointCollection.cs
- AttachmentService.cs
- _ListenerAsyncResult.cs
- NullToBooleanConverter.cs
- TypeDescriptionProviderAttribute.cs
- CodeConditionStatement.cs
- ScalarRestriction.cs
- SelectionEditor.cs
- Cursors.cs
- FieldBuilder.cs
- DataColumnMapping.cs
- ADMembershipProvider.cs
- XmlHelper.cs
- FormViewInsertEventArgs.cs
- parserscommon.cs
- lengthconverter.cs
- PagesChangedEventArgs.cs
- SpecialNameAttribute.cs
- ViewStateModeByIdAttribute.cs
- EDesignUtil.cs
- typedescriptorpermission.cs
- OleDbException.cs
- WebInvokeAttribute.cs
- MulticastOption.cs
- ClockGroup.cs
- DynamicDiscoSearcher.cs
- PermissionToken.cs
- FixedSchema.cs
- EnumerableRowCollectionExtensions.cs
- TimeoutValidationAttribute.cs
- Polygon.cs
- StringFreezingAttribute.cs
- RequestedSignatureDialog.cs
- DateTimeConstantAttribute.cs
- SqlFactory.cs
- DataGridViewComboBoxCell.cs
- FileRegion.cs
- SortDescriptionCollection.cs
- PropertyEmitterBase.cs
- BoolLiteral.cs
- SQLDoubleStorage.cs
- TabletDevice.cs
- COM2Enum.cs
- DocumentXmlWriter.cs
- NetworkInterface.cs
- AssemblyHash.cs
- ProtocolElementCollection.cs
- AssemblyBuilderData.cs
- XmlQueryType.cs
- TrackingServices.cs
- EdmValidator.cs
- Matrix3D.cs
- UrlAuthFailureHandler.cs
- TextSerializer.cs
- Pair.cs
- ClrProviderManifest.cs
- ResourceSet.cs
- AsyncSerializedWorker.cs
- DivideByZeroException.cs
- ContainerAction.cs
- HeaderedItemsControl.cs
- OpacityConverter.cs
- DoubleCollectionValueSerializer.cs
- UserUseLicenseDictionaryLoader.cs
- IISMapPath.cs
- FlowDocumentPage.cs
- Point3DCollection.cs
- IdentitySection.cs