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
- CodeAttributeArgumentCollection.cs
- SqlBinder.cs
- DataGridItem.cs
- TableRowGroup.cs
- EntityCommandCompilationException.cs
- BaseAsyncResult.cs
- UserInitiatedNavigationPermission.cs
- UserPersonalizationStateInfo.cs
- SimpleApplicationHost.cs
- DocumentApplicationJournalEntry.cs
- BitmapFrame.cs
- VisualStyleElement.cs
- WorkflowRuntimeService.cs
- Annotation.cs
- AssociationTypeEmitter.cs
- IisTraceListener.cs
- RedirectionProxy.cs
- WCFBuildProvider.cs
- XmlAtomicValue.cs
- StringPropertyBuilder.cs
- webeventbuffer.cs
- CodeExporter.cs
- SchemaImporterExtension.cs
- Int16.cs
- WebResponse.cs
- TableStyle.cs
- XmlSchemaSimpleTypeList.cs
- IdnElement.cs
- FieldAccessException.cs
- TextRangeSerialization.cs
- IList.cs
- HttpClientCredentialType.cs
- nulltextcontainer.cs
- ConsumerConnectionPointCollection.cs
- WorkflowTimerService.cs
- AxHost.cs
- ContextProperty.cs
- TreeView.cs
- ToolStripRenderer.cs
- MetadataFile.cs
- WarningException.cs
- StylusCaptureWithinProperty.cs
- StateDesigner.LayoutSelectionGlyph.cs
- GenericEnumConverter.cs
- ObjectKeyFrameCollection.cs
- LoginCancelEventArgs.cs
- SequentialWorkflowHeaderFooter.cs
- SerializationException.cs
- ItemMap.cs
- OleDbMetaDataFactory.cs
- PartialTrustVisibleAssembliesSection.cs
- Helper.cs
- dataobject.cs
- BinaryConverter.cs
- SendMessageChannelCache.cs
- BitmapDownload.cs
- Control.cs
- AssemblyAttributesGoHere.cs
- TextDecorationUnitValidation.cs
- WhitespaceSignificantCollectionAttribute.cs
- WebPartUtil.cs
- DSASignatureDeformatter.cs
- TypedElement.cs
- RoleService.cs
- ToolStripLocationCancelEventArgs.cs
- StructuredTypeInfo.cs
- ModuleBuilder.cs
- ModelUIElement3D.cs
- SoapAttributeAttribute.cs
- RegistryPermission.cs
- BinarySerializer.cs
- HandleRef.cs
- LassoHelper.cs
- SocketElement.cs
- XmlStreamStore.cs
- CompilerResults.cs
- UnknownBitmapDecoder.cs
- ObjectAnimationBase.cs
- PreviewPrintController.cs
- ToolStripDropDownButton.cs
- SystemWebExtensionsSectionGroup.cs
- TextEditorTyping.cs
- HTMLTextWriter.cs
- DataGridViewRowPostPaintEventArgs.cs
- NameScope.cs
- ContainerVisual.cs
- CalloutQueueItem.cs
- MULTI_QI.cs
- PolyQuadraticBezierSegment.cs
- CompiledQueryCacheEntry.cs
- remotingproxy.cs
- CodeConditionStatement.cs
- ForeignKeyConstraint.cs
- InstanceNotFoundException.cs
- InputScope.cs
- InternalDuplexChannelListener.cs
- ByteViewer.cs
- HtmlElementErrorEventArgs.cs
- UserValidatedEventArgs.cs
- WSHttpTransportSecurityElement.cs