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
- FieldCollectionEditor.cs
- CompiledXpathExpr.cs
- DescendentsWalker.cs
- XPathPatternBuilder.cs
- TypeGeneratedEventArgs.cs
- ListItem.cs
- SatelliteContractVersionAttribute.cs
- Duration.cs
- FileDataSourceCache.cs
- ControlBuilderAttribute.cs
- ViewgenGatekeeper.cs
- DataGridTextBox.cs
- ICspAsymmetricAlgorithm.cs
- ResourceReferenceExpressionConverter.cs
- XmlDataLoader.cs
- DnsPermission.cs
- MenuCommandService.cs
- WebPartConnectionsCancelEventArgs.cs
- WebUtil.cs
- NativeMethods.cs
- CompositionAdorner.cs
- HierarchicalDataSourceControl.cs
- PerformanceCounterManager.cs
- NestPullup.cs
- Int16Converter.cs
- TabRenderer.cs
- DataRecord.cs
- SolidColorBrush.cs
- XslUrlEditor.cs
- LayoutSettings.cs
- IIS7UserPrincipal.cs
- Logging.cs
- RpcAsyncResult.cs
- NativeMethods.cs
- StringValueConverter.cs
- DiscardableAttribute.cs
- PropertyItemInternal.cs
- WebHostUnsafeNativeMethods.cs
- OrCondition.cs
- PackagePart.cs
- Underline.cs
- ConstrainedDataObject.cs
- UnsafeNativeMethods.cs
- SharingService.cs
- M3DUtil.cs
- SHA384.cs
- ComPlusInstanceProvider.cs
- LinkClickEvent.cs
- querybuilder.cs
- CompilerState.cs
- AsyncInvokeContext.cs
- WebPartManagerInternals.cs
- RuntimeResourceSet.cs
- BezierSegment.cs
- _WinHttpWebProxyDataBuilder.cs
- SharedPerformanceCounter.cs
- MexHttpsBindingElement.cs
- SourceChangedEventArgs.cs
- FactoryMaker.cs
- RegexTree.cs
- UrlMappingCollection.cs
- StatusBarItem.cs
- ConnectionsZone.cs
- PeerTransportElement.cs
- Win32Interop.cs
- EntityCommandDefinition.cs
- EntryWrittenEventArgs.cs
- PrintDialog.cs
- SafeCryptContextHandle.cs
- RuntimeIdentifierPropertyAttribute.cs
- IsolatedStorageFile.cs
- PagerSettings.cs
- ProvidePropertyAttribute.cs
- SolidColorBrush.cs
- FilteredAttributeCollection.cs
- Tuple.cs
- _NestedMultipleAsyncResult.cs
- DataViewSettingCollection.cs
- BuildProviderCollection.cs
- AsymmetricKeyExchangeFormatter.cs
- ToolboxSnapDragDropEventArgs.cs
- Vector3DIndependentAnimationStorage.cs
- RoutedEventArgs.cs
- ArrayConverter.cs
- ActivationServices.cs
- CharStorage.cs
- TagMapInfo.cs
- Geometry.cs
- SchemaTableColumn.cs
- TreeNode.cs
- Decorator.cs
- Border.cs
- HtmlElementCollection.cs
- ChannelManager.cs
- ToolStripArrowRenderEventArgs.cs
- Form.cs
- DateRangeEvent.cs
- KnownIds.cs
- MachineKeySection.cs
- RuntimeHandles.cs