Code:
/ 4.0 / 4.0 / 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. /* **************************************************************************** * * 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
- TextureBrush.cs
- MultilineStringConverter.cs
- PixelFormats.cs
- WebServiceData.cs
- XmlReader.cs
- RC2.cs
- ManualResetEvent.cs
- _HeaderInfoTable.cs
- XmlSchemaInclude.cs
- SynchronizedChannelCollection.cs
- RegexMatch.cs
- DataGridViewCellMouseEventArgs.cs
- Utils.cs
- NameValuePermission.cs
- MethodBody.cs
- ForEachDesigner.xaml.cs
- SecurityRuntime.cs
- NonValidatingSecurityTokenAuthenticator.cs
- DetailsViewInsertEventArgs.cs
- InkPresenterAutomationPeer.cs
- XmlDomTextWriter.cs
- SchemaCollectionPreprocessor.cs
- BrushConverter.cs
- ItemsControl.cs
- XmlElementAttributes.cs
- ScriptControl.cs
- TransactionFlowBindingElement.cs
- StickyNoteAnnotations.cs
- odbcmetadatacolumnnames.cs
- AssemblyAttributesGoHere.cs
- XPathScanner.cs
- IChannel.cs
- ResponseBodyWriter.cs
- ProtocolsConfiguration.cs
- PropertyItemInternal.cs
- QilVisitor.cs
- DataDesignUtil.cs
- TrustLevelCollection.cs
- HttpAsyncResult.cs
- TextEditorTyping.cs
- ClientRuntimeConfig.cs
- DesignBindingValueUIHandler.cs
- COM2PictureConverter.cs
- SQLResource.cs
- ValidationSummary.cs
- InternalResources.cs
- AvTrace.cs
- SelectionHighlightInfo.cs
- XPathBinder.cs
- BufferBuilder.cs
- LoginViewDesigner.cs
- PropertyValueUIItem.cs
- XXXOnTypeBuilderInstantiation.cs
- PropertiesTab.cs
- XmlRootAttribute.cs
- AdapterDictionary.cs
- HTMLTagNameToTypeMapper.cs
- XmlSchemaException.cs
- DatePicker.cs
- ToolStripTemplateNode.cs
- SessionEndingCancelEventArgs.cs
- DataSourceDesigner.cs
- DrawingState.cs
- ProtocolReflector.cs
- DataStorage.cs
- PerfService.cs
- DummyDataSource.cs
- TextParagraphCache.cs
- BuilderInfo.cs
- VirtualDirectoryMapping.cs
- Screen.cs
- D3DImage.cs
- HtmlValidatorAdapter.cs
- StrongNameUtility.cs
- InfoCardRSACryptoProvider.cs
- TransformPattern.cs
- SymLanguageType.cs
- NonSerializedAttribute.cs
- DiscoveryClientChannelBase.cs
- AttachedAnnotation.cs
- DecoderBestFitFallback.cs
- SubMenuStyle.cs
- SamlAssertion.cs
- PointLightBase.cs
- CqlIdentifiers.cs
- RemotingClientProxy.cs
- OutgoingWebResponseContext.cs
- GenericTypeParameterBuilder.cs
- XmlArrayItemAttribute.cs
- XmlNullResolver.cs
- PerfCounters.cs
- QueryContinueDragEvent.cs
- StyleSelector.cs
- PrefixQName.cs
- WebPermission.cs
- Annotation.cs
- streamingZipPartStream.cs
- MinMaxParagraphWidth.cs
- Path.cs
- SimpleType.cs