Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Expressions / IndexerHelper.cs / 1305376 / IndexerHelper.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Expressions { using System.Activities.Validation; using System.Collections.Generic; using System.Linq.Expressions; using System.Runtime; using System.Collections.ObjectModel; using System.Reflection; static class IndexerHelper { public static void OnGetArguments(Collection indices, OutArgument > result, CodeActivityMetadata metadata) { for (int i = 0; i < indices.Count; i++) { RuntimeArgument indexArgument = new RuntimeArgument("Index" + i, indices[i].ArgumentType, ArgumentDirection.In, true); metadata.Bind(indices[i], indexArgument); metadata.AddArgument(indexArgument); } RuntimeArgument resultArgument = new RuntimeArgument("Result", typeof(Location ), ArgumentDirection.Out); metadata.Bind(result, resultArgument); metadata.AddArgument(resultArgument); } public static void CacheMethod (Collection indices, ref MethodInfo getMethod, ref MethodInfo setMethod) { Type[] getTypes = new Type[indices.Count]; for (int i = 0; i < indices.Count; i++) { getTypes[i] = indices[i].ArgumentType; } getMethod = typeof(TOperand).GetMethod("get_Item", getTypes); if (getMethod != null && !getMethod.IsSpecialName) { getMethod = null; } Type[] setTypes = new Type[indices.Count + 1]; for (int i = 0; i < indices.Count; i++) { setTypes[i] = indices[i].ArgumentType; } setTypes[setTypes.Length - 1] = typeof(TItem); setMethod = typeof(TOperand).GetMethod("set_Item", setTypes); if (setMethod != null && !setMethod.IsSpecialName) { setMethod = null; } } } } // 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
- ReadOnlyTernaryTree.cs
- IItemContainerGenerator.cs
- XmlSchemaException.cs
- InterleavedZipPartStream.cs
- Descriptor.cs
- ApplyTemplatesAction.cs
- ItemContainerGenerator.cs
- HandledEventArgs.cs
- SystemKeyConverter.cs
- TabPage.cs
- PrefixQName.cs
- CompositeCollection.cs
- WebContext.cs
- DBCSCodePageEncoding.cs
- ConfigurationSectionCollection.cs
- StyleBamlRecordReader.cs
- TabletDevice.cs
- PropertyGridEditorPart.cs
- ZipArchive.cs
- SafeCertificateContext.cs
- InstancePersistenceEvent.cs
- PreDigestedSignedInfo.cs
- UserUseLicenseDictionaryLoader.cs
- EpmContentSerializer.cs
- ToolboxComponentsCreatedEventArgs.cs
- Page.cs
- UInt64.cs
- BaseProcessor.cs
- IgnoreDeviceFilterElement.cs
- TypedReference.cs
- VersionedStream.cs
- SqlFacetAttribute.cs
- WindowsRebar.cs
- HashAlgorithm.cs
- EventHandlerList.cs
- RemotingConfigParser.cs
- PerformanceCounterPermissionEntry.cs
- HybridDictionary.cs
- DeleteIndexBinder.cs
- ComboBox.cs
- UriTemplateQueryValue.cs
- State.cs
- EmbeddedMailObjectsCollection.cs
- DataTableNewRowEvent.cs
- GridViewColumnCollection.cs
- DataGridViewColumnCollectionDialog.cs
- CodeDomLoader.cs
- PopupControlService.cs
- ScrollProperties.cs
- AdCreatedEventArgs.cs
- GridViewUpdatedEventArgs.cs
- XmlSerializationReader.cs
- OleDbPermission.cs
- streamingZipPartStream.cs
- SoapInteropTypes.cs
- RetrieveVirtualItemEventArgs.cs
- oledbconnectionstring.cs
- SemanticResultKey.cs
- SqlLiftWhereClauses.cs
- SerializableAttribute.cs
- SmtpReplyReader.cs
- SqlReferenceCollection.cs
- AspCompat.cs
- ZipIOExtraFieldElement.cs
- IPipelineRuntime.cs
- Compiler.cs
- ImportContext.cs
- CharacterMetrics.cs
- UnorderedHashRepartitionStream.cs
- ChangeProcessor.cs
- MappingModelBuildProvider.cs
- CodeTypeDeclaration.cs
- DoubleMinMaxAggregationOperator.cs
- AsymmetricAlgorithm.cs
- SynchronizedDisposablePool.cs
- sqlstateclientmanager.cs
- LogArchiveSnapshot.cs
- Buffer.cs
- webbrowsersite.cs
- PersonalizationAdministration.cs
- TdsValueSetter.cs
- PrintDocument.cs
- SamlEvidence.cs
- AdRotator.cs
- FrugalMap.cs
- PathNode.cs
- PowerStatus.cs
- SamlConstants.cs
- InlineCategoriesDocument.cs
- FirewallWrapper.cs
- AsymmetricSignatureDeformatter.cs
- InfoCardTrace.cs
- MarkerProperties.cs
- LocalBuilder.cs
- PrintControllerWithStatusDialog.cs
- MenuItemStyleCollectionEditor.cs
- HttpListenerResponse.cs
- DataBinding.cs
- XmlParser.cs
- TreeNodeConverter.cs