Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / IndexObject.cs / 1 / IndexObject.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.InfoCards { using System; using System.Collections.Specialized; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Threading; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary: // Internal class that unifies the location that index values are created, // and how they are created. // // Remarks: // This class is for internal store use only. // internal class IndexObject { object[] m_objects; byte[] m_compiledForm; // // Summary: // Creates an instance of an IndexObject using uncompiled objects // // Remarks: // // Parameters: // objects: the list of object that will make this index entry. // public IndexObject( object[] objects ) { m_objects = objects; } // // Summary: // Creates an instance of an IndexObject with a raw compiled form // // Remarks: // // Parameters: // compiledForm: the binary of the compiled form to use. // public IndexObject( byte[] compiledForm ) { m_compiledForm = compiledForm; } // // Summary: // Gets a bool indicating that the data is compiled // public bool IsCompiled { get{ return null != m_compiledForm; } } // // Summary: // Gets a bool indicating if the object has data to compile // public bool CanCompile { get{ return null != m_objects; } } // // Summary: // Gets a pointer to the raw compiled buffer // public byte[] CompiledForm { get{ return m_compiledForm; } } // // Summary: // Gets a pointer to the uncompiled object array // public object[] ObjectList { get{ return m_objects; } } // // Summary: // Compiles the object using the specified definintion // // Parameters: // indexDef: The indexDef that defines how to compile this object. // internal void Compile( SecondaryIndexDefinition indexDef ) { if( !CanCompile ) { throw IDT.ThrowHelperError( new InvalidOperationException( SR.GetString( SR.StoreIndexObjectCanNotBeCompiled ) ) ); } byte[] buffer = new byte[ SecondaryIndexItem.HashValueSize ]; int index = 0; for( int i=0;ibuffer.Length ) { throw IDT.ThrowHelperError( new InvalidOperationException( SR.GetString( SR.StoreIndexObjectBufferOverflow, indexDef.Name ) ) ); } Array.Copy( canonicalForm, 0, buffer, index, canonicalForm.Length ); index += canonicalForm.Length; } m_compiledForm = buffer; } } } // 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
- ObjectDataSourceEventArgs.cs
- SmiMetaData.cs
- WindowsMenu.cs
- PtsCache.cs
- RequestCacheValidator.cs
- DataServiceException.cs
- QueryOutputWriter.cs
- ChineseLunisolarCalendar.cs
- BidPrivateBase.cs
- WindowsGraphicsWrapper.cs
- SystemIPInterfaceStatistics.cs
- SafePointer.cs
- CheckPair.cs
- TextEditorCharacters.cs
- WinFormsUtils.cs
- CommandID.cs
- WindowsIdentity.cs
- SelectedDatesCollection.cs
- SurrogateSelector.cs
- InputGestureCollection.cs
- MemoryMappedViewStream.cs
- DbResourceAllocator.cs
- ReferencedAssembly.cs
- RuleElement.cs
- PageContent.cs
- SettingsPropertyCollection.cs
- DateTimePicker.cs
- ComPlusDiagnosticTraceSchemas.cs
- SynchronousReceiveBehavior.cs
- InternalBufferOverflowException.cs
- UserPrincipalNameElement.cs
- DependencyPropertyAttribute.cs
- WebPartDisplayMode.cs
- TextServicesHost.cs
- CodeDomSerializerBase.cs
- NetPeerTcpBindingCollectionElement.cs
- AuthStoreRoleProvider.cs
- ByteKeyFrameCollection.cs
- ConnectorRouter.cs
- ThreadStartException.cs
- CommonDialog.cs
- DesignerMetadata.cs
- FilterElement.cs
- DragSelectionMessageFilter.cs
- SafeCryptContextHandle.cs
- BitmapEffectDrawingContextState.cs
- PointAnimationBase.cs
- FileDialog.cs
- WebFormsRootDesigner.cs
- DownloadProgressEventArgs.cs
- DbParameterCollection.cs
- GenericTypeParameterBuilder.cs
- DefaultHttpHandler.cs
- DeviceContext.cs
- XmlCountingReader.cs
- __Filters.cs
- SoapInteropTypes.cs
- OracleSqlParser.cs
- GridViewDeleteEventArgs.cs
- NavigationWindow.cs
- TextInfo.cs
- SplitterPanelDesigner.cs
- BaseUriHelper.cs
- SqlDataSourceView.cs
- SqlUnionizer.cs
- RightsManagementUser.cs
- SQLBytesStorage.cs
- RelationshipType.cs
- DoubleStorage.cs
- HttpListenerPrefixCollection.cs
- UnsafeNativeMethods.cs
- SmtpDigestAuthenticationModule.cs
- HashMembershipCondition.cs
- DbReferenceCollection.cs
- TypefaceCollection.cs
- SafeCloseHandleCritical.cs
- ReferenceEqualityComparer.cs
- BoolExpr.cs
- _NegoState.cs
- SmiSettersStream.cs
- WebPartAddingEventArgs.cs
- PrivilegeNotHeldException.cs
- Padding.cs
- Vector3DValueSerializer.cs
- TextServicesCompartmentEventSink.cs
- OutputCacheModule.cs
- Vector3DKeyFrameCollection.cs
- CannotUnloadAppDomainException.cs
- TreeViewImageGenerator.cs
- ThousandthOfEmRealDoubles.cs
- FileVersion.cs
- StylusPoint.cs
- IsolatedStorageFilePermission.cs
- SerialPinChanges.cs
- DateTimeValueSerializerContext.cs
- EntityDataSourceUtil.cs
- SystemColors.cs
- JobStaple.cs
- Metafile.cs
- Icon.cs