Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / Runtime / CompilerServices / MethodImplAttribute.cs / 1 / MethodImplAttribute.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
namespace System.Runtime.CompilerServices {
using System;
using System.Reflection;
// This Enum matchs the miImpl flags defined in corhdr.h. It is used to specify
// certain method properties.
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
public enum MethodImplOptions
{
Unmanaged = System.Reflection.MethodImplAttributes.Unmanaged,
ForwardRef = System.Reflection.MethodImplAttributes.ForwardRef,
PreserveSig = System.Reflection.MethodImplAttributes.PreserveSig,
InternalCall = System.Reflection.MethodImplAttributes.InternalCall,
Synchronized = System.Reflection.MethodImplAttributes.Synchronized,
NoInlining = System.Reflection.MethodImplAttributes.NoInlining,
NoOptimization = System.Reflection.MethodImplAttributes.NoOptimization,
// **** If you add something, update internal MethodImplAttribute(MethodImplAttributes methodImplAttributes)! ****
}
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum MethodCodeType
{
IL = System.Reflection.MethodImplAttributes.IL,
Native = System.Reflection.MethodImplAttributes.Native,
///
OPTIL = System.Reflection.MethodImplAttributes.OPTIL,
Runtime = System.Reflection.MethodImplAttributes.Runtime
}
// Custom attribute to specify additional method properties.
[Serializable, AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)]
[System.Runtime.InteropServices.ComVisible(true)]
sealed public class MethodImplAttribute : Attribute
{
internal MethodImplOptions _val;
public MethodCodeType MethodCodeType;
internal MethodImplAttribute(MethodImplAttributes methodImplAttributes)
{
MethodImplOptions all =
MethodImplOptions.Unmanaged | MethodImplOptions.ForwardRef | MethodImplOptions.PreserveSig |
MethodImplOptions.InternalCall | MethodImplOptions.Synchronized | MethodImplOptions.NoInlining |
MethodImplOptions.NoOptimization;
_val = ((MethodImplOptions)methodImplAttributes) & all;
}
public MethodImplAttribute(MethodImplOptions methodImplOptions)
{
_val = methodImplOptions;
}
public MethodImplAttribute(short value)
{
_val = (MethodImplOptions)value;
}
public MethodImplAttribute()
{
}
public MethodImplOptions Value { get {return _val;} }
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
namespace System.Runtime.CompilerServices {
using System;
using System.Reflection;
// This Enum matchs the miImpl flags defined in corhdr.h. It is used to specify
// certain method properties.
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
public enum MethodImplOptions
{
Unmanaged = System.Reflection.MethodImplAttributes.Unmanaged,
ForwardRef = System.Reflection.MethodImplAttributes.ForwardRef,
PreserveSig = System.Reflection.MethodImplAttributes.PreserveSig,
InternalCall = System.Reflection.MethodImplAttributes.InternalCall,
Synchronized = System.Reflection.MethodImplAttributes.Synchronized,
NoInlining = System.Reflection.MethodImplAttributes.NoInlining,
NoOptimization = System.Reflection.MethodImplAttributes.NoOptimization,
// **** If you add something, update internal MethodImplAttribute(MethodImplAttributes methodImplAttributes)! ****
}
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum MethodCodeType
{
IL = System.Reflection.MethodImplAttributes.IL,
Native = System.Reflection.MethodImplAttributes.Native,
///
OPTIL = System.Reflection.MethodImplAttributes.OPTIL,
Runtime = System.Reflection.MethodImplAttributes.Runtime
}
// Custom attribute to specify additional method properties.
[Serializable, AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)]
[System.Runtime.InteropServices.ComVisible(true)]
sealed public class MethodImplAttribute : Attribute
{
internal MethodImplOptions _val;
public MethodCodeType MethodCodeType;
internal MethodImplAttribute(MethodImplAttributes methodImplAttributes)
{
MethodImplOptions all =
MethodImplOptions.Unmanaged | MethodImplOptions.ForwardRef | MethodImplOptions.PreserveSig |
MethodImplOptions.InternalCall | MethodImplOptions.Synchronized | MethodImplOptions.NoInlining |
MethodImplOptions.NoOptimization;
_val = ((MethodImplOptions)methodImplAttributes) & all;
}
public MethodImplAttribute(MethodImplOptions methodImplOptions)
{
_val = methodImplOptions;
}
public MethodImplAttribute(short value)
{
_val = (MethodImplOptions)value;
}
public MethodImplAttribute()
{
}
public MethodImplOptions Value { get {return _val;} }
}
}
// 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
- DynamicUpdateCommand.cs
- HtmlHistory.cs
- BlurEffect.cs
- M3DUtil.cs
- DelegateSerializationHolder.cs
- TypedDataSourceCodeGenerator.cs
- TypeNameConverter.cs
- TypeDefinition.cs
- StringSorter.cs
- StylusCollection.cs
- DataGridTableCollection.cs
- HMAC.cs
- RangeValidator.cs
- DataServicePagingProviderWrapper.cs
- RadioButtonList.cs
- EntityContainerRelationshipSet.cs
- DataGridBeginningEditEventArgs.cs
- HotSpot.cs
- WebPartAuthorizationEventArgs.cs
- FunctionOverloadResolver.cs
- WriteTimeStream.cs
- CommandExpr.cs
- DataServiceRequest.cs
- GregorianCalendarHelper.cs
- ValidatorCollection.cs
- ApplicationId.cs
- DockProviderWrapper.cs
- DataGridItemAutomationPeer.cs
- ControlTemplate.cs
- ClrProviderManifest.cs
- IgnorePropertiesAttribute.cs
- ParserStreamGeometryContext.cs
- ContextMenuService.cs
- SqlColumnizer.cs
- ColorConverter.cs
- QueryRelOp.cs
- TextEditorLists.cs
- DTCTransactionManager.cs
- WorkflowInstanceExtensionManager.cs
- CachedFontFamily.cs
- XPathEmptyIterator.cs
- ContainerSelectorBehavior.cs
- FilterElement.cs
- FixedElement.cs
- FlagsAttribute.cs
- ItemCheckEvent.cs
- XmlValidatingReader.cs
- List.cs
- XsltFunctions.cs
- NoPersistHandle.cs
- StyleSheetRefUrlEditor.cs
- WhileDesigner.xaml.cs
- FormatSettings.cs
- SmtpCommands.cs
- SmiRequestExecutor.cs
- AmbientValueAttribute.cs
- UniqueConstraint.cs
- RC2.cs
- StrokeNodeData.cs
- WebPartDescription.cs
- ZoneIdentityPermission.cs
- SqlTypesSchemaImporter.cs
- SecureUICommand.cs
- WebDescriptionAttribute.cs
- WCFServiceClientProxyGenerator.cs
- ErrorWebPart.cs
- Console.cs
- SchemaMapping.cs
- DecoderBestFitFallback.cs
- XmlSchemaChoice.cs
- TimeSpanConverter.cs
- SegmentInfo.cs
- QueryCacheManager.cs
- Aggregates.cs
- ContainerUtilities.cs
- InboundActivityHelper.cs
- DataGridViewRowPrePaintEventArgs.cs
- HostingEnvironmentException.cs
- IndexedGlyphRun.cs
- MetadataItem.cs
- HotSpotCollectionEditor.cs
- HtmlControlDesigner.cs
- RTTypeWrapper.cs
- DebugHandleTracker.cs
- FontStyles.cs
- SmtpAuthenticationManager.cs
- UTF7Encoding.cs
- InstallerTypeAttribute.cs
- HelpHtmlBuilder.cs
- Rect3D.cs
- EncoderFallback.cs
- XmlProcessingInstruction.cs
- DbDataSourceEnumerator.cs
- WebPartDisplayMode.cs
- DataObjectFieldAttribute.cs
- DataContract.cs
- FontFamily.cs
- SelectorItemAutomationPeer.cs
- PeerNameResolver.cs
- WebRequestModuleElementCollection.cs