Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Util / SimpleBitVector32.cs / 1 / SimpleBitVector32.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Util { 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 IntegerValue { get { return data; } set { data = value; } } internal bool this[int bit] { get { return (data & bit) == bit; } set { int _data = data; if(value) { data = _data | bit; } else { data = _data & ~bit; } } } internal void Set(int bit) { data |= bit; } internal void Clear(int bit) { data &= ~bit; } #if UNUSED_CODE 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; } internal int Data { get { return data; } set { data = value; } } #endif } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EmptyStringExpandableObjectConverter.cs
- MSG.cs
- PropertyRecord.cs
- OleCmdHelper.cs
- IndividualDeviceConfig.cs
- FrameworkContentElementAutomationPeer.cs
- Psha1DerivedKeyGenerator.cs
- DataTableExtensions.cs
- SmiEventSink.cs
- CodeTypeOfExpression.cs
- XmlSchemas.cs
- EmptyQuery.cs
- ThemeInfoAttribute.cs
- ColumnCollection.cs
- WindowsTokenRoleProvider.cs
- ToolBar.cs
- PolyQuadraticBezierSegment.cs
- HtmlInputCheckBox.cs
- WebHttpSecurity.cs
- Message.cs
- PersonalizationStateInfoCollection.cs
- DbFunctionCommandTree.cs
- PreDigestedSignedInfo.cs
- SendMessageChannelCache.cs
- SqlDependency.cs
- ScrollEventArgs.cs
- XmlReflectionMember.cs
- InertiaRotationBehavior.cs
- KeyMatchBuilder.cs
- EntityDataReader.cs
- OleDbMetaDataFactory.cs
- ZipIOExtraField.cs
- MSG.cs
- AssociationSet.cs
- HiddenField.cs
- TypeUtil.cs
- XXXInfos.cs
- UserControl.cs
- Int16.cs
- CreateUserWizard.cs
- PropertyFilterAttribute.cs
- SerializableAttribute.cs
- SingleStorage.cs
- ConstantProjectedSlot.cs
- DataGridViewRowHeaderCell.cs
- EnvelopedPkcs7.cs
- TokenBasedSet.cs
- HttpHandlerActionCollection.cs
- BrowserTree.cs
- SAPIEngineTypes.cs
- Monitor.cs
- SafeNativeMethodsCLR.cs
- HtmlEmptyTagControlBuilder.cs
- GeneralTransform2DTo3D.cs
- ConvertEvent.cs
- Crc32.cs
- HandleTable.cs
- WeakEventManager.cs
- PartialTrustVisibleAssembliesSection.cs
- FormViewDeleteEventArgs.cs
- TextCompositionManager.cs
- FieldToken.cs
- QueryableDataSourceView.cs
- unsafenativemethodstextservices.cs
- Viewport2DVisual3D.cs
- IdnElement.cs
- SqlClientPermission.cs
- CheckBoxList.cs
- PeerInputChannel.cs
- CellIdBoolean.cs
- ComponentFactoryHelpers.cs
- WhitespaceRule.cs
- WebUtil.cs
- XappLauncher.cs
- Table.cs
- NativeMethods.cs
- DomainLiteralReader.cs
- PowerModeChangedEventArgs.cs
- FontFamily.cs
- PrivacyNoticeBindingElement.cs
- _FixedSizeReader.cs
- Style.cs
- GeometryDrawing.cs
- WindowsHyperlink.cs
- Utils.cs
- Matrix3D.cs
- StylusButtonCollection.cs
- VideoDrawing.cs
- Vector3D.cs
- TextHidden.cs
- arabicshape.cs
- XmlNodeWriter.cs
- PointLightBase.cs
- XmlValueConverter.cs
- EventMap.cs
- StaticSiteMapProvider.cs
- FixedStringLookup.cs
- DynamicDocumentPaginator.cs
- XmlQueryOutput.cs
- TopClause.cs