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
- CharacterMetricsDictionary.cs
- log.cs
- GridViewRow.cs
- ErrorHandler.cs
- BinaryObjectReader.cs
- SqlBulkCopyColumnMappingCollection.cs
- DataGridPageChangedEventArgs.cs
- HebrewCalendar.cs
- GridViewDeleteEventArgs.cs
- SafeNativeMethods.cs
- SubMenuStyleCollection.cs
- LineGeometry.cs
- DataServiceConfiguration.cs
- DataConnectionHelper.cs
- Comparer.cs
- SettingsProperty.cs
- UserInitiatedNavigationPermission.cs
- IpcClientChannel.cs
- XmlSchemaSearchPattern.cs
- DatatypeImplementation.cs
- HostnameComparisonMode.cs
- PointLight.cs
- Socket.cs
- ScriptBehaviorDescriptor.cs
- ProcessModuleCollection.cs
- StringUtil.cs
- HttpProxyTransportBindingElement.cs
- MarkedHighlightComponent.cs
- CommonServiceBehaviorElement.cs
- MLangCodePageEncoding.cs
- HttpRequestWrapper.cs
- XPathNodePointer.cs
- HMACSHA384.cs
- Triangle.cs
- ProtocolsSection.cs
- AnnotationResourceChangedEventArgs.cs
- OrderedHashRepartitionStream.cs
- CreationContext.cs
- EventKeyword.cs
- StandardOleMarshalObject.cs
- PlatformCulture.cs
- IApplicationTrustManager.cs
- SymbolPair.cs
- File.cs
- InvalidCardException.cs
- StateItem.cs
- DebuggerAttributes.cs
- MetaModel.cs
- InstanceValue.cs
- SqlGatherConsumedAliases.cs
- UnsafeNativeMethods.cs
- DbProviderConfigurationHandler.cs
- WpfGeneratedKnownProperties.cs
- StreamGeometry.cs
- AdRotator.cs
- FormatException.cs
- RelationshipFixer.cs
- Content.cs
- __ConsoleStream.cs
- FormsAuthenticationConfiguration.cs
- DefinitionUpdate.cs
- OrderedParallelQuery.cs
- UpdateRecord.cs
- SqlConnectionFactory.cs
- SecurityCriticalDataForSet.cs
- CellParaClient.cs
- ListControlConvertEventArgs.cs
- BaseDataBoundControl.cs
- AudioFormatConverter.cs
- WsdlHelpGeneratorElement.cs
- WorkflowServiceNamespace.cs
- Span.cs
- NamespaceInfo.cs
- TranslateTransform3D.cs
- ObsoleteAttribute.cs
- SqlTriggerContext.cs
- TransportSecurityProtocol.cs
- TabItemAutomationPeer.cs
- SystemResources.cs
- ZipArchive.cs
- HttpListenerElement.cs
- ApplicationContext.cs
- SrgsGrammarCompiler.cs
- AttachedAnnotationChangedEventArgs.cs
- HtmlProps.cs
- Int32.cs
- PriorityChain.cs
- Image.cs
- WCFBuildProvider.cs
- ConfigurationException.cs
- DropAnimation.xaml.cs
- ConstructorExpr.cs
- ProgressPage.cs
- LocalizedNameDescriptionPair.cs
- GrammarBuilderBase.cs
- InvalidDataException.cs
- AliasGenerator.cs
- ProcessStartInfo.cs
- State.cs
- MultiView.cs