Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Scripting / Compiler / DelegateHelpers.cs / 1305376 / DelegateHelpers.cs
/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Microsoft Public License. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Microsoft Public License, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Microsoft Public License. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ using System.Dynamic.Utils; using System.Reflection; using System.Reflection.Emit; namespace System.Linq.Expressions.Compiler { internal static partial class DelegateHelpers { private const MethodAttributes CtorAttributes = MethodAttributes.RTSpecialName | MethodAttributes.HideBySig | MethodAttributes.Public; private const MethodImplAttributes ImplAttributes = MethodImplAttributes.Runtime | MethodImplAttributes.Managed; private const MethodAttributes InvokeAttributes = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Virtual; private static readonly Type[] _DelegateCtorSignature = new Type[] { typeof(object), typeof(IntPtr) }; private static Type MakeNewCustomDelegate(Type[] types) { Type returnType = types[types.Length - 1]; Type[] parameters = types.RemoveLast(); TypeBuilder builder = AssemblyGen.DefineDelegateType("Delegate" + types.Length); builder.DefineConstructor(CtorAttributes, CallingConventions.Standard, _DelegateCtorSignature).SetImplementationFlags(ImplAttributes); builder.DefineMethod("Invoke", InvokeAttributes, returnType, parameters).SetImplementationFlags(ImplAttributes); return builder.CreateType(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FixedDocumentSequencePaginator.cs
- RecognitionResult.cs
- UniqueContractNameValidationBehavior.cs
- TextDecorationLocationValidation.cs
- InkCanvasSelection.cs
- ReadOnlyDataSourceView.cs
- CurrencyWrapper.cs
- XmlDocumentFragment.cs
- X509CertificateChain.cs
- HtmlElementEventArgs.cs
- CodeMemberField.cs
- NullNotAllowedCollection.cs
- QilTargetType.cs
- HttpConfigurationSystem.cs
- QuarticEase.cs
- ECDsa.cs
- ControlPersister.cs
- DataConnectionHelper.cs
- ToolStripSeparatorRenderEventArgs.cs
- AggregatePushdown.cs
- ConsoleEntryPoint.cs
- WebPartsPersonalizationAuthorization.cs
- NetStream.cs
- TextFormattingConverter.cs
- CompressStream.cs
- CalloutQueueItem.cs
- DataConnectionHelper.cs
- NativeMethods.cs
- MembershipPasswordException.cs
- MimeParameters.cs
- MaskDescriptors.cs
- InputElement.cs
- TableProviderWrapper.cs
- Variable.cs
- ContourSegment.cs
- QuaternionRotation3D.cs
- SubclassTypeValidator.cs
- WindowsComboBox.cs
- TextBlockAutomationPeer.cs
- HtmlMeta.cs
- ContextQuery.cs
- ClientConfigPaths.cs
- ExtendedProperty.cs
- ToolStripItemTextRenderEventArgs.cs
- EventProxy.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- EntityViewGenerationConstants.cs
- RefreshEventArgs.cs
- PeerNearMe.cs
- FacetValueContainer.cs
- NotifyInputEventArgs.cs
- BatchWriter.cs
- TraceHandler.cs
- RectangleGeometry.cs
- PassportAuthenticationModule.cs
- EntityDescriptor.cs
- BitSet.cs
- AppDomainFactory.cs
- EditorAttributeInfo.cs
- WmpBitmapEncoder.cs
- _Semaphore.cs
- RegexMatchCollection.cs
- FileDetails.cs
- ITextView.cs
- MediaSystem.cs
- SpecialFolderEnumConverter.cs
- SqlAliasesReferenced.cs
- TextTreeTextBlock.cs
- SqlCommandBuilder.cs
- CachedPathData.cs
- ExportException.cs
- XmlSchemaAny.cs
- BaseCodePageEncoding.cs
- HandlerFactoryWrapper.cs
- DocumentViewer.cs
- Pipe.cs
- TextFormatterHost.cs
- ConfigurationStrings.cs
- RightsManagementManager.cs
- FunctionImportMapping.cs
- RichTextBox.cs
- EntityClientCacheEntry.cs
- NameValuePair.cs
- StrokeNode.cs
- CurrentChangingEventArgs.cs
- QilFunction.cs
- PersonalizationProviderHelper.cs
- ComboBoxRenderer.cs
- VisualTarget.cs
- LingerOption.cs
- EmptyEnumerable.cs
- DbInsertCommandTree.cs
- AttachmentService.cs
- XmlProcessingInstruction.cs
- ServiceHttpModule.cs
- ReliableChannelListener.cs
- EntityTransaction.cs
- ToolStripHighContrastRenderer.cs
- XmlSchemaAnnotated.cs
- ConsoleCancelEventArgs.cs