Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / SimpleBitVector32.cs / 1305376 / SimpleBitVector32.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System; // // This is a cut down copy of System.Collections.Specialized.BitVector32. The // reason this is here is because it is used rather intensively by Control and // WebControl. As a result, being able to inline this operations results in a // measurable performance gain, at the expense of some maintainability. // [Serializable] internal struct SimpleBitVector32 { private int data; internal SimpleBitVector32(int data) { this.data = data; } internal int Data { get { return data; } #if UNUSED_CODE set { data = value; } #endif } internal bool this[int bit] { get { return (data & bit) == bit; } set { int _data = data; if(value) { data = _data | bit; } else { data = _data & ~bit; } } } #if UNUSED_CODE internal void Set(int bit) { data |= bit; } internal void Clear(int bit) { data &= ~bit; } internal void Toggle(int bit) { data ^= bit; } /* * COPY_FLAG copies the value of flags from a source field * into a destination field. * * In the macro: * + "&flag" limits the outer xor operation to just the flag we're interested in. * + These are the results of the two xor operations: * * fieldDst fieldSrc inner xor outer xor * 0 0 0 0 * 0 1 1 1 * 1 0 1 0 * 1 1 0 1 */ internal void Copy(SimpleBitVector32 src, int bit) { data ^= (data ^ src.data) & bit; } #endif } } // 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
- AssemblyCacheEntry.cs
- ConfigsHelper.cs
- AppDomainUnloadedException.cs
- HyperlinkAutomationPeer.cs
- FormClosedEvent.cs
- DataServiceBuildProvider.cs
- SynchronizedCollection.cs
- HtmlWindowCollection.cs
- PermissionToken.cs
- NativeObjectSecurity.cs
- ValueUtilsSmi.cs
- TransformGroup.cs
- ListControl.cs
- LambdaCompiler.ControlFlow.cs
- InternalTypeHelper.cs
- LicFileLicenseProvider.cs
- OpacityConverter.cs
- SiteIdentityPermission.cs
- EventPropertyMap.cs
- WebPermission.cs
- AttributeQuery.cs
- SmiRecordBuffer.cs
- ContourSegment.cs
- WSDualHttpSecurityMode.cs
- TriggerCollection.cs
- ApplicationHost.cs
- DataGridViewRowsAddedEventArgs.cs
- FormViewPagerRow.cs
- VectorKeyFrameCollection.cs
- MatrixIndependentAnimationStorage.cs
- JournalNavigationScope.cs
- DynamicUpdateCommand.cs
- PreservationFileWriter.cs
- TextDecorationCollection.cs
- ScriptControl.cs
- TreeNodeCollectionEditorDialog.cs
- Serializer.cs
- XmlMembersMapping.cs
- DrawingContextWalker.cs
- MessageTraceRecord.cs
- ClientScriptManager.cs
- PrtTicket_Base.cs
- HttpPostedFile.cs
- RegexFCD.cs
- MimeTextImporter.cs
- ContentElementAutomationPeer.cs
- InputBinder.cs
- _NestedMultipleAsyncResult.cs
- HtmlFormParameterWriter.cs
- SafeTimerHandle.cs
- FixedDSBuilder.cs
- XmlAttributeProperties.cs
- SQLDateTimeStorage.cs
- HttpProfileBase.cs
- NegatedCellConstant.cs
- EmptyStringExpandableObjectConverter.cs
- DetailsView.cs
- FaultFormatter.cs
- WindowsTokenRoleProvider.cs
- XamlSerializerUtil.cs
- ArgIterator.cs
- DebuggerService.cs
- XmlSchemaGroupRef.cs
- StackOverflowException.cs
- ObjectRef.cs
- LineInfo.cs
- ListenerSessionConnectionReader.cs
- DesignerActionVerbItem.cs
- FormsAuthenticationEventArgs.cs
- HttpModuleCollection.cs
- HttpCacheVary.cs
- ParenthesizePropertyNameAttribute.cs
- KnownColorTable.cs
- DbCommandTree.cs
- RuntimeConfig.cs
- Pkcs7Recipient.cs
- EndpointDiscoveryElement.cs
- LoginName.cs
- XmlMapping.cs
- ControlBindingsCollection.cs
- ActivityStatusChangeEventArgs.cs
- PeerApplication.cs
- FacetDescriptionElement.cs
- Int64Storage.cs
- SizeLimitedCache.cs
- DateTimeFormatInfo.cs
- ArraySegment.cs
- UserMapPath.cs
- PropertyMetadata.cs
- PresentationUIStyleResources.cs
- RegexCaptureCollection.cs
- ScriptingSectionGroup.cs
- Attributes.cs
- LicenseProviderAttribute.cs
- GridViewEditEventArgs.cs
- TypedTableGenerator.cs
- DocumentGridContextMenu.cs
- Rect.cs
- ExpressionBindings.cs
- ThemeDirectoryCompiler.cs