Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Linq / Parallel / QueryOperators / ListQueryResults.cs / 1305376 / ListQueryResults.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // ListQueryResults.cs // //[....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; namespace System.Linq.Parallel { ////// Class to represent an IList{T} as QueryResults{T} /// ///internal class ListQueryResults : QueryResults { private IList m_source; private int m_partitionCount; private bool m_useStriping; internal ListQueryResults(IList source, int partitionCount, bool useStriping) { m_source = source; m_partitionCount = partitionCount; m_useStriping = useStriping; } internal override void GivePartitionedStream(IPartitionedStreamRecipient recipient) { PartitionedStream partitionedStream = GetPartitionedStream(); recipient.Receive (partitionedStream); } internal override bool IsIndexible { get { return true; } } internal override int ElementsCount { get { return m_source.Count; } } internal override T GetElement(int index) { return m_source[index]; } internal PartitionedStream GetPartitionedStream() { return ExchangeUtilities.PartitionDataSource(m_source, m_partitionCount, m_useStriping); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // ListQueryResults.cs // // [....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; namespace System.Linq.Parallel { ////// Class to represent an IList{T} as QueryResults{T} /// ///internal class ListQueryResults : QueryResults { private IList m_source; private int m_partitionCount; private bool m_useStriping; internal ListQueryResults(IList source, int partitionCount, bool useStriping) { m_source = source; m_partitionCount = partitionCount; m_useStriping = useStriping; } internal override void GivePartitionedStream(IPartitionedStreamRecipient recipient) { PartitionedStream partitionedStream = GetPartitionedStream(); recipient.Receive (partitionedStream); } internal override bool IsIndexible { get { return true; } } internal override int ElementsCount { get { return m_source.Count; } } internal override T GetElement(int index) { return m_source[index]; } internal PartitionedStream GetPartitionedStream() { return ExchangeUtilities.PartitionDataSource(m_source, m_partitionCount, m_useStriping); } } } // 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
- PageThemeBuildProvider.cs
- SqlDataSourceSummaryPanel.cs
- HtmlInputButton.cs
- Msmq4PoisonHandler.cs
- DecimalFormatter.cs
- Site.cs
- PeerNameRecord.cs
- ProjectionPruner.cs
- OperationResponse.cs
- ImageList.cs
- PropertyConverter.cs
- _DisconnectOverlappedAsyncResult.cs
- OutputCacheProfileCollection.cs
- EditorPartDesigner.cs
- RadioButtonList.cs
- DisplayMemberTemplateSelector.cs
- ListViewContainer.cs
- CreateRefExpr.cs
- Size3DValueSerializer.cs
- ZoneButton.cs
- BoolExpressionVisitors.cs
- Activator.cs
- ActivityBindForm.Designer.cs
- Conditional.cs
- DBAsyncResult.cs
- DataStreamFromComStream.cs
- Privilege.cs
- Nodes.cs
- TextMarkerSource.cs
- RemotingClientProxy.cs
- MultiplexingDispatchMessageFormatter.cs
- Exceptions.cs
- FreezableDefaultValueFactory.cs
- Byte.cs
- DataPagerFieldItem.cs
- autovalidator.cs
- XmlSchemaGroupRef.cs
- OdbcReferenceCollection.cs
- InternalConfigSettingsFactory.cs
- FragmentQueryKB.cs
- CheckBox.cs
- RtfControlWordInfo.cs
- SequenceDesignerAccessibleObject.cs
- httpserverutility.cs
- PeerNearMe.cs
- TextEmbeddedObject.cs
- WebPartMinimizeVerb.cs
- Track.cs
- SweepDirectionValidation.cs
- FixedTextContainer.cs
- ReadWriteSpinLock.cs
- SQLCharsStorage.cs
- GuidelineSet.cs
- DocumentOrderQuery.cs
- MenuItem.cs
- NonClientArea.cs
- AttributeAction.cs
- PublisherMembershipCondition.cs
- TargetInvocationException.cs
- CLRBindingWorker.cs
- CodeVariableDeclarationStatement.cs
- HttpListenerResponse.cs
- PackagingUtilities.cs
- LOSFormatter.cs
- NamedObject.cs
- CodeCompileUnit.cs
- Models.cs
- Regex.cs
- SafeRegistryKey.cs
- MexNamedPipeBindingElement.cs
- XXXInfos.cs
- SortKey.cs
- MLangCodePageEncoding.cs
- IDispatchConstantAttribute.cs
- XmlEncodedRawTextWriter.cs
- UserControlFileEditor.cs
- Menu.cs
- CompilationPass2Task.cs
- CustomValidator.cs
- DesignerRegionCollection.cs
- ToolStripItemClickedEventArgs.cs
- RMEnrollmentPage3.cs
- DataListGeneralPage.cs
- StrokeDescriptor.cs
- ActionFrame.cs
- TcpClientSocketManager.cs
- TreeView.cs
- EndOfStreamException.cs
- CriticalFinalizerObject.cs
- basenumberconverter.cs
- ButtonField.cs
- WebPartConnectionsDisconnectVerb.cs
- _ListenerAsyncResult.cs
- ClientConfigPaths.cs
- ListDictionaryInternal.cs
- EUCJPEncoding.cs
- HttpWebRequest.cs
- TypedRowHandler.cs
- ToolStripDropDownClosedEventArgs.cs
- DataListItemCollection.cs