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
- IsolatedStoragePermission.cs
- StandardCommands.cs
- AppearanceEditorPart.cs
- ReadOnlyState.cs
- DetailsViewDeletedEventArgs.cs
- RectangleHotSpot.cs
- CreateUserWizard.cs
- StringStorage.cs
- InputScope.cs
- _DisconnectOverlappedAsyncResult.cs
- Brush.cs
- PerformanceCounter.cs
- CompleteWizardStep.cs
- TreeViewEvent.cs
- BorderGapMaskConverter.cs
- NodeCounter.cs
- FeatureSupport.cs
- HtmlEmptyTagControlBuilder.cs
- SmtpNetworkElement.cs
- WSSecurityPolicy11.cs
- ButtonField.cs
- GeneralTransform2DTo3D.cs
- RecognitionResult.cs
- HttpGetProtocolReflector.cs
- IERequestCache.cs
- WinEventTracker.cs
- ByteAnimation.cs
- ObjectReferenceStack.cs
- BitmapEffectCollection.cs
- Int64.cs
- ChangeDirector.cs
- TcpSocketManager.cs
- ApplyTemplatesAction.cs
- DataViewListener.cs
- TextServicesCompartmentEventSink.cs
- CacheDict.cs
- ConsoleCancelEventArgs.cs
- PropertyToken.cs
- ProcessHostConfigUtils.cs
- MetadataProperty.cs
- DynamicPropertyHolder.cs
- ProcessThreadCollection.cs
- SafeRightsManagementPubHandle.cs
- Math.cs
- Model3DGroup.cs
- HTTPAPI_VERSION.cs
- WorkflowMessageEventArgs.cs
- InfoCardClaim.cs
- TimeoutTimer.cs
- MultiSelector.cs
- OleDbStruct.cs
- ToolBar.cs
- SelectionUIHandler.cs
- WindowsListViewItem.cs
- FontSourceCollection.cs
- StatusBarAutomationPeer.cs
- ConstructorArgumentAttribute.cs
- Compress.cs
- InstanceDataCollectionCollection.cs
- SponsorHelper.cs
- ScriptServiceAttribute.cs
- oledbmetadatacolumnnames.cs
- ConnectionManagementElementCollection.cs
- IriParsingElement.cs
- ColorConvertedBitmapExtension.cs
- XhtmlBasicTextViewAdapter.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- BufferedGraphicsContext.cs
- ProcessModuleDesigner.cs
- OleDbConnectionFactory.cs
- RootProfilePropertySettingsCollection.cs
- DataGridCellsPanel.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- UTF32Encoding.cs
- RepeaterItem.cs
- XmlSchemaSimpleContent.cs
- _BasicClient.cs
- PolyQuadraticBezierSegment.cs
- SoapRpcMethodAttribute.cs
- TextWriter.cs
- FormViewDeleteEventArgs.cs
- CachedTypeface.cs
- DataTableReader.cs
- RemoteWebConfigurationHostStream.cs
- ProtocolsConfiguration.cs
- VisualStyleRenderer.cs
- XsdBuildProvider.cs
- MimeMapping.cs
- BitArray.cs
- XPathItem.cs
- DataGridViewCellEventArgs.cs
- DbMetaDataFactory.cs
- WebServiceEnumData.cs
- GifBitmapDecoder.cs
- Int16Converter.cs
- Int32EqualityComparer.cs
- recordstate.cs
- HwndPanningFeedback.cs
- LateBoundBitmapDecoder.cs
- DescriptionAttribute.cs