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
- DesignTimeVisibleAttribute.cs
- TextBlock.cs
- HierarchicalDataSourceControl.cs
- WhitespaceRule.cs
- Menu.cs
- AssociationType.cs
- ColorDialog.cs
- MimeMapping.cs
- XmlElementCollection.cs
- LogStore.cs
- BaseValidator.cs
- BevelBitmapEffect.cs
- MetafileHeader.cs
- PinnedBufferMemoryStream.cs
- Vector3DCollectionConverter.cs
- Table.cs
- FormConverter.cs
- ToolstripProfessionalRenderer.cs
- Context.cs
- InstanceCreationEditor.cs
- TemplateControlCodeDomTreeGenerator.cs
- SpotLight.cs
- LOSFormatter.cs
- ModelPerspective.cs
- PeerUnsafeNativeCryptMethods.cs
- SQLSingle.cs
- PageVisual.cs
- UniqueID.cs
- XmlSchemaIdentityConstraint.cs
- UInt64.cs
- AccessDataSourceDesigner.cs
- NetworkInformationException.cs
- SqlErrorCollection.cs
- XXXInfos.cs
- WebPartTracker.cs
- ScriptManagerProxy.cs
- OfTypeExpression.cs
- OracleInfoMessageEventArgs.cs
- WebPartManagerInternals.cs
- UpdateCommand.cs
- HMACRIPEMD160.cs
- EntityContainerRelationshipSet.cs
- RoleService.cs
- WindowsHyperlink.cs
- ConstraintStruct.cs
- GeometryConverter.cs
- DataView.cs
- VisualTreeUtils.cs
- ElementMarkupObject.cs
- TableLayoutSettingsTypeConverter.cs
- SecurityUtils.cs
- DetailsViewRowCollection.cs
- InternalPermissions.cs
- EntitySetBase.cs
- SvcMapFileLoader.cs
- PriorityChain.cs
- Image.cs
- Util.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- DeviceContexts.cs
- CorrelationKey.cs
- DesignBinding.cs
- DataRowChangeEvent.cs
- FeatureSupport.cs
- ConfigXmlCDataSection.cs
- CodeCatchClause.cs
- RichTextBoxConstants.cs
- TagPrefixCollection.cs
- ReadOnlyKeyedCollection.cs
- SBCSCodePageEncoding.cs
- RelatedPropertyManager.cs
- TagMapInfo.cs
- Clause.cs
- ReferenceEqualityComparer.cs
- ChannelReliableSession.cs
- RuleSetCollection.cs
- FacetChecker.cs
- LoginDesignerUtil.cs
- _FixedSizeReader.cs
- ConnectionPoint.cs
- FieldNameLookup.cs
- ExtensionElement.cs
- VirtualDirectoryMapping.cs
- EventArgs.cs
- BuildProviderCollection.cs
- Frame.cs
- X509Chain.cs
- CodeDirectoryCompiler.cs
- GroupBoxDesigner.cs
- SchemaImporterExtensionElement.cs
- URLString.cs
- EventEntry.cs
- RepeaterCommandEventArgs.cs
- WorkflowElementDialogWindow.xaml.cs
- _IPv4Address.cs
- DiscriminatorMap.cs
- ToolTipAutomationPeer.cs
- ComponentGlyph.cs
- XmlAggregates.cs
- SystemWebCachingSectionGroup.cs