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
- MsmqDiagnostics.cs
- InputScope.cs
- GeneralTransformCollection.cs
- LineBreakRecord.cs
- ListBindingHelper.cs
- UseLicense.cs
- TemplateBindingExtensionConverter.cs
- BrowserDefinition.cs
- Solver.cs
- TextDecoration.cs
- GridViewSortEventArgs.cs
- GC.cs
- AttributeEmitter.cs
- OpCellTreeNode.cs
- DataTableCollection.cs
- IfAction.cs
- FragmentQueryKB.cs
- ClientBuildManagerCallback.cs
- _SSPISessionCache.cs
- SettingsPropertyValue.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- TripleDES.cs
- ZipIOCentralDirectoryBlock.cs
- HierarchicalDataTemplate.cs
- ValidationRuleCollection.cs
- BitArray.cs
- ViewLoader.cs
- FolderLevelBuildProviderCollection.cs
- MultilineStringConverter.cs
- DependencyProperty.cs
- SchemaInfo.cs
- SafeReversePInvokeHandle.cs
- WebBrowserSiteBase.cs
- SHA384Managed.cs
- AudioException.cs
- DataTrigger.cs
- AppSettingsReader.cs
- HeaderedContentControl.cs
- SamlAuthenticationStatement.cs
- XPathItem.cs
- ControlType.cs
- ExtensionSimplifierMarkupObject.cs
- FailedToStartupUIException.cs
- UpdateCompiler.cs
- InternalBufferOverflowException.cs
- MultipartIdentifier.cs
- DataObjectFieldAttribute.cs
- Shape.cs
- DataGridAddNewRow.cs
- TextParagraphView.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- GZipUtils.cs
- FilteredDataSetHelper.cs
- DrawingServices.cs
- EndpointDesigner.cs
- FontConverter.cs
- FileLogRecord.cs
- ResourceAssociationSet.cs
- EventDescriptor.cs
- BinaryObjectWriter.cs
- ListViewItem.cs
- DefaultWorkflowTransactionService.cs
- DrawingBrush.cs
- RegistryPermission.cs
- InvalidCastException.cs
- XamlToRtfWriter.cs
- TdsParserStaticMethods.cs
- PeerNameResolver.cs
- BaseProcessor.cs
- Knowncolors.cs
- FormatConvertedBitmap.cs
- XmlILModule.cs
- LazyTextWriterCreator.cs
- Int32CollectionValueSerializer.cs
- TypeResolvingOptionsAttribute.cs
- CodeEntryPointMethod.cs
- IsolatedStorageException.cs
- UnitySerializationHolder.cs
- SQLString.cs
- EditingScopeUndoUnit.cs
- XPathDocument.cs
- Timer.cs
- MouseWheelEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- TextRange.cs
- NumericExpr.cs
- BuildProvider.cs
- ResourceDictionaryCollection.cs
- PopupRoot.cs
- BufferedGraphics.cs
- PresentationAppDomainManager.cs
- WebRequestModuleElement.cs
- DataStreams.cs
- TextCompositionManager.cs
- SafeProcessHandle.cs
- SlotInfo.cs
- XmlAttributeProperties.cs
- XmlEventCache.cs
- SqlReferenceCollection.cs
- Brush.cs