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
- PrintController.cs
- DictionaryEntry.cs
- DotExpr.cs
- Opcode.cs
- CacheHelper.cs
- CreateUserErrorEventArgs.cs
- Section.cs
- X509CertificateStore.cs
- Sentence.cs
- DbConnectionPoolCounters.cs
- UriParserTemplates.cs
- BatchServiceHost.cs
- NameValueCollection.cs
- Condition.cs
- cookiecollection.cs
- HtmlLink.cs
- ToolStripStatusLabel.cs
- AnnotationResourceChangedEventArgs.cs
- GridErrorDlg.cs
- SyntaxCheck.cs
- PromptStyle.cs
- XmlCDATASection.cs
- Types.cs
- SystemIPv6InterfaceProperties.cs
- AsyncInvokeOperation.cs
- TraceSection.cs
- ScriptMethodAttribute.cs
- SortedDictionary.cs
- UnsafeNativeMethods.cs
- LocalizationComments.cs
- CodeSnippetExpression.cs
- WrapperSecurityCommunicationObject.cs
- JsonDeserializer.cs
- ContentPlaceHolder.cs
- MsmqInputChannelListener.cs
- TextWriterTraceListener.cs
- ConfigXmlElement.cs
- StandardToolWindows.cs
- ThreadStaticAttribute.cs
- ResXBuildProvider.cs
- ResXDataNode.cs
- WindowsListViewGroup.cs
- XmlSchemaGroup.cs
- EdmEntityTypeAttribute.cs
- SynchronizedDisposablePool.cs
- AliasGenerator.cs
- SHA256Managed.cs
- Message.cs
- FixedSOMTextRun.cs
- TextMetrics.cs
- MappingSource.cs
- DataControlLinkButton.cs
- FusionWrap.cs
- SequentialOutput.cs
- StrokeRenderer.cs
- CollectionChangedEventManager.cs
- NotCondition.cs
- Point3DCollection.cs
- XmlSchemaSimpleContentExtension.cs
- UdpTransportBindingElement.cs
- GeometryHitTestResult.cs
- PathTooLongException.cs
- EntryPointNotFoundException.cs
- SchemaCreator.cs
- DynamicQueryStringParameter.cs
- EncodingNLS.cs
- CodePageUtils.cs
- HtmlControl.cs
- ProfilePropertySettings.cs
- Dynamic.cs
- TypeConverterHelper.cs
- GeneralTransform3DGroup.cs
- TabControlEvent.cs
- EarlyBoundInfo.cs
- PresentationTraceSources.cs
- SoapServerProtocol.cs
- AddDataControlFieldDialog.cs
- DynamicPropertyHolder.cs
- ReadOnlyCollection.cs
- BindingList.cs
- ImageListImageEditor.cs
- NegotiateStream.cs
- WebEventCodes.cs
- SimpleHandlerFactory.cs
- XamlClipboardData.cs
- updateconfighost.cs
- TreeViewAutomationPeer.cs
- LayoutManager.cs
- ContextMenu.cs
- TextRangeEditLists.cs
- Metafile.cs
- SamlAudienceRestrictionCondition.cs
- AttributeParameterInfo.cs
- BitmapVisualManager.cs
- PermissionListSet.cs
- OdbcRowUpdatingEvent.cs
- BitmapImage.cs
- ButtonColumn.cs
- Convert.cs
- DBAsyncResult.cs