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
- SecurityUtils.cs
- DesignerDataSchemaClass.cs
- LineServicesRun.cs
- UnionCodeGroup.cs
- Vector3DConverter.cs
- XD.cs
- Image.cs
- Fonts.cs
- TimeSpanStorage.cs
- MobileControl.cs
- ToolStripRenderEventArgs.cs
- MonitoringDescriptionAttribute.cs
- WSHttpBindingBaseElement.cs
- DirectionalLight.cs
- DifferencingCollection.cs
- WebFormDesignerActionService.cs
- SqlError.cs
- IdnElement.cs
- InputProviderSite.cs
- XmlQueryTypeFactory.cs
- CalloutQueueItem.cs
- NegationPusher.cs
- CodeCompiler.cs
- input.cs
- ApplicationServicesHostFactory.cs
- DateTimeSerializationSection.cs
- MetadataSerializer.cs
- ChannelServices.cs
- OperationValidationEventArgs.cs
- SqlDeflator.cs
- RemotingConfigParser.cs
- FontFamilyValueSerializer.cs
- GeneralTransformGroup.cs
- AggregateException.cs
- OracleRowUpdatingEventArgs.cs
- SplineKeyFrames.cs
- DES.cs
- ZoneButton.cs
- PeerPresenceInfo.cs
- EFTableProvider.cs
- WebPartConnectionsCloseVerb.cs
- TileBrush.cs
- SchemaMapping.cs
- BevelBitmapEffect.cs
- BamlRecordWriter.cs
- ClientRoleProvider.cs
- NativeMethods.cs
- XmlSchemaGroup.cs
- QueryStoreStatusRequest.cs
- RangeEnumerable.cs
- IProvider.cs
- TextContainerChangedEventArgs.cs
- SoapIgnoreAttribute.cs
- DBCommand.cs
- PersistenceTypeAttribute.cs
- ResourceWriter.cs
- XsdDataContractImporter.cs
- FloaterBaseParaClient.cs
- ToolStripContainerActionList.cs
- DataSourceCacheDurationConverter.cs
- DateTimeFormat.cs
- TaskCanceledException.cs
- DataBinder.cs
- XmlSerializerAssemblyAttribute.cs
- WindowsFormsEditorServiceHelper.cs
- ExtensionSimplifierMarkupObject.cs
- ExternalException.cs
- TypeUtil.cs
- Rectangle.cs
- NavigationPropertyEmitter.cs
- PeerValidationBehavior.cs
- Misc.cs
- CodePageUtils.cs
- ServiceKnownTypeAttribute.cs
- TextTabProperties.cs
- XmlNamespaceDeclarationsAttribute.cs
- RotationValidation.cs
- DesignerHierarchicalDataSourceView.cs
- PolicyValidationException.cs
- Trace.cs
- StringPropertyBuilder.cs
- UnmanagedMemoryStreamWrapper.cs
- SafeRegistryHandle.cs
- DragEvent.cs
- SevenBitStream.cs
- ObjectConverter.cs
- HashCryptoHandle.cs
- elementinformation.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- OdbcErrorCollection.cs
- ZipPackagePart.cs
- ObjectFullSpanRewriter.cs
- NotConverter.cs
- Int32Converter.cs
- Missing.cs
- FastEncoder.cs
- FolderLevelBuildProviderCollection.cs
- XmlSchemaInfo.cs
- HandleRef.cs
- InputLanguage.cs