// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*==============================================================================
**
** Class: Assembly
**
** [....]
** [....]
**
**
** Purpose: For Assembly-related stuff.
**
**
=============================================================================*/
namespace System.Reflection
{
using System;
using System.Collections;
using System.Collections.Generic;
using CultureInfo = System.Globalization.CultureInfo;
using System.Security;
using System.Security.Policy;
using System.Security.Permissions;
using System.IO;
using System.Reflection.Cache;
using StringBuilder = System.Text.StringBuilder;
using System.Configuration.Assemblies;
using StackCrawlMark = System.Threading.StackCrawlMark;
using System.Runtime.InteropServices;
#if FEATURE_SERIALIZATION
using BinaryFormatter = System.Runtime.Serialization.Formatters.Binary.BinaryFormatter;
#endif // FEATURE_SERIALIZATION
using System.Runtime.CompilerServices;
using SecurityZone = System.Security.SecurityZone;
using IEvidenceFactory = System.Security.IEvidenceFactory;
using System.Runtime.Serialization;
using Microsoft.Win32;
using System.Threading;
using __HResults = System.__HResults;
using System.Runtime.Versioning;
using System.Diagnostics.Contracts;
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public delegate Module ModuleResolveEventHandler(Object sender, ResolveEventArgs e);
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(_Assembly))]
[System.Runtime.InteropServices.ComVisible(true)]
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Unrestricted = true)]
public abstract class Assembly : _Assembly, IEvidenceFactory, ICustomAttributeProvider, ISerializable
{
#region constructors
protected Assembly() {}
#endregion
#region public static methods
[ResourceExposure(ResourceScope.None)]
public static String CreateQualifiedName(String assemblyName, String typeName)
{
return typeName + ", " + assemblyName;
}
public static Assembly GetAssembly(Type type)
{
if (type == null)
throw new ArgumentNullException("type");
Contract.EndContractBlock();
Module m = type.Module;
if (m == null)
return null;
else
return m.Assembly;
}
#if !FEATURE_CORECLR
public static bool operator ==(Assembly left, Assembly right)
{
if (ReferenceEquals(left, right))
return true;
if ((object)left == null || (object)right == null ||
left is RuntimeAssembly || right is RuntimeAssembly)
{
return false;
}
return left.Equals(right);
}
public static bool operator !=(Assembly left, Assembly right)
{
return !(left == right);
}
public override bool Equals(object o)
{
return base.Equals(o);
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endif // !FEATURE_CORECLR
// Locate an assembly by the name of the file containing the manifest.
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly LoadFrom(String assemblyFile)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFrom(
assemblyFile,
null, // securityEvidence
null, // hashValue
AssemblyHashAlgorithm.None,
false,// forIntrospection
false,// suppressSecurityChecks
ref stackMark);
}
// Locate an assembly for reflection by the name of the file containing the manifest.
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly ReflectionOnlyLoadFrom(String assemblyFile)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFrom(
assemblyFile,
null, //securityEvidence
null, //hashValue
AssemblyHashAlgorithm.None,
true, //forIntrospection
false, //suppressSecurityChecks
ref stackMark);
}
// Evidence is protected in Assembly.Load()
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
[Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly LoadFrom(String assemblyFile,
Evidence securityEvidence)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFrom(
assemblyFile,
securityEvidence,
null, // hashValue
AssemblyHashAlgorithm.None,
false,// forIntrospection);
false,// suppressSecurityChecks
ref stackMark);
}
// Evidence is protected in Assembly.Load()
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
[Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly LoadFrom(String assemblyFile,
Evidence securityEvidence,
byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFrom(
assemblyFile,
securityEvidence,
hashValue,
hashAlgorithm,
false,
false,
ref stackMark);
}
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly LoadFrom(String assemblyFile,
byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFrom(
assemblyFile,
null,
hashValue,
hashAlgorithm,
false,
false,
ref stackMark);
}
#if FEATURE_CAS_POLICY
// Load an assembly into the LoadFrom context bypassing some security checks
[SecurityCritical]
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly UnsafeLoadFrom(string assemblyFile)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFrom(assemblyFile,
null, // securityEvidence
null, // hashValue
AssemblyHashAlgorithm.None,
false, // forIntrospection
true, // suppressSecurityChecks
ref stackMark);
}
#endif // FEATURE_CAS_POLICY
// Locate an assembly by the long form of the assembly name.
// eg. "Toolbox.dll, version=1.1.10.1220, locale=en, publickey=1234567890123456789012345678901234567890"
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly Load(String assemblyString)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoad(assemblyString, null, ref stackMark, false /*forIntrospection*/);
}
// Locate an assembly for reflection by the long form of the assembly name.
// eg. "Toolbox.dll, version=1.1.10.1220, locale=en, publickey=1234567890123456789012345678901234567890"
//
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly ReflectionOnlyLoad(String assemblyString)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoad(assemblyString, null, ref stackMark, true /*forIntrospection*/);
}
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public static Assembly Load(String assemblyString, Evidence assemblySecurity)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoad(assemblyString, assemblySecurity, ref stackMark, false /*forIntrospection*/);
}
// Locate an assembly by its name. The name can be strong or
// weak. The assembly is loaded into the domain of the caller.
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly Load(AssemblyName assemblyRef)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadAssemblyName(assemblyRef, null, ref stackMark, false /*forIntrospection*/, false /*suppressSecurityChecks*/);
}
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public static Assembly Load(AssemblyName assemblyRef, Evidence assemblySecurity)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadAssemblyName(assemblyRef, assemblySecurity, ref stackMark, false /*forIntrospection*/, false /*suppressSecurityChecks*/);
}
#if FEATURE_FUSION
[System.Security.SecuritySafeCritical] // auto-generated
[Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly LoadWithPartialName(String partialName)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.LoadWithPartialNameInternal(partialName, null, ref stackMark);
}
[System.Security.SecuritySafeCritical] // auto-generated
[Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly LoadWithPartialName(String partialName, Evidence securityEvidence)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.LoadWithPartialNameInternal(partialName, securityEvidence, ref stackMark);
}
#endif // FEATURE_FUSION
// Loads the assembly with a COFF based IMAGE containing
// an emitted assembly. The assembly is loaded into the domain
// of the caller.
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly Load(byte[] rawAssembly)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.nLoadImage(
rawAssembly,
null, // symbol store
null, // evidence
ref stackMark,
false, // fIntrospection
SecurityContextSource.CurrentAssembly);
}
// Loads the assembly for reflection with a COFF based IMAGE containing
// an emitted assembly. The assembly is loaded into the domain
// of the caller.
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly ReflectionOnlyLoad(byte[] rawAssembly)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.nLoadImage(
rawAssembly,
null, // symbol store
null, // evidence
ref stackMark,
true, // fIntrospection
SecurityContextSource.CurrentAssembly);
}
// Loads the assembly with a COFF based IMAGE containing
// an emitted assembly. The assembly is loaded into the domain
// of the caller. The second parameter is the raw bytes
// representing the symbol store that matches the assembly.
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly Load(byte[] rawAssembly,
byte[] rawSymbolStore)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.nLoadImage(
rawAssembly,
rawSymbolStore,
null, // evidence
ref stackMark,
false, // fIntrospection
SecurityContextSource.CurrentAssembly);
}
// Load an assembly from a byte array, controlling where the grant set of this assembly is
// propigated from.
[SecuritySafeCritical]
[MethodImpl(MethodImplOptions.NoInlining)] // Due to the stack crawl mark
public static Assembly Load(byte[] rawAssembly,
byte[] rawSymbolStore,
SecurityContextSource securityContextSource)
{
if (securityContextSource < SecurityContextSource.CurrentAppDomain ||
securityContextSource > SecurityContextSource.CurrentAssembly)
{
throw new ArgumentOutOfRangeException("securityContextSource");
}
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.nLoadImage(rawAssembly,
rawSymbolStore,
null, // evidence
ref stackMark,
false, // fIntrospection
securityContextSource);
}
[System.Security.SecuritySafeCritical] // auto-generated
[SecurityPermissionAttribute(SecurityAction.Demand, Flags=SecurityPermissionFlag.ControlEvidence)]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
[Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public static Assembly Load(byte[] rawAssembly,
byte[] rawSymbolStore,
Evidence securityEvidence)
{
#if FEATURE_CAS_POLICY
if (securityEvidence != null && !AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled)
{
// A zone of MyComputer could not have been used to sandbox, so for compatibility we do not
// throw an exception when we see it.
Zone zone = securityEvidence.GetHostEvidence();
if (zone == null || zone.SecurityZone != SecurityZone.MyComputer)
{
throw new NotSupportedException(Environment.GetResourceString("NotSupported_RequiresCasPolicyImplicit"));
}
}
#endif // FEATURE_CAS_POLICY
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.nLoadImage(
rawAssembly,
rawSymbolStore,
securityEvidence,
ref stackMark,
false, // fIntrospection
SecurityContextSource.CurrentAssembly);
}
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
public static Assembly LoadFile(String path)
{
new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, path).Demand();
return RuntimeAssembly.nLoadFile(path, null);
}
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
[SecurityPermissionAttribute(SecurityAction.Demand, Flags=SecurityPermissionFlag.ControlEvidence)]
[Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFile which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
public static Assembly LoadFile(String path,
Evidence securityEvidence)
{
#if FEATURE_CAS_POLICY
if (securityEvidence != null && !AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled)
{
throw new NotSupportedException(Environment.GetResourceString("NotSupported_RequiresCasPolicyImplicit"));
}
#endif // FEATURE_CAS_POLICY
new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, path).Demand();
return RuntimeAssembly.nLoadFile(path, securityEvidence);
}
#if FEATURE_CORECLR
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly Load(Stream assemblyStream, Stream pdbStream)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFromStream(assemblyStream, pdbStream, ref stackMark);
}
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly Load(Stream assemblyStream)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoadFromStream(assemblyStream, null, ref stackMark);
}
#endif //FEATURE_CORECLR
/*
* Get the assembly that the current code is running from.
*/
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly GetExecutingAssembly()
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.GetExecutingAssembly(ref stackMark);
}
[System.Security.SecuritySafeCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly GetCallingAssembly()
{
// LookForMyCallersCaller is not guarantee to return the correct stack frame
// because of inlining, tail calls, etc. As a result GetCallingAssembly is not
// ganranteed to return the correct result. We should document it as such.
StackCrawlMark stackMark = StackCrawlMark.LookForMyCallersCaller;
return RuntimeAssembly.GetExecutingAssembly(ref stackMark);
}
#if !FEATURE_CORECLR
[System.Security.SecuritySafeCritical] // auto-generated
public static Assembly GetEntryAssembly() {
AppDomainManager domainManager = AppDomain.CurrentDomain.DomainManager;
if (domainManager == null)
domainManager = new AppDomainManager();
return domainManager.EntryAssembly;
}
#endif // !FEATURE_CORECLR
#endregion // public static methods
#region public methods
public virtual event ModuleResolveEventHandler ModuleResolve
{
[System.Security.SecurityCritical] // auto-generated_required
add
{
throw new NotImplementedException();
}
[System.Security.SecurityCritical] // auto-generated_required
remove
{
throw new NotImplementedException();
}
}
public virtual String CodeBase
{
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
get
{
throw new NotImplementedException();
}
}
public virtual String EscapedCodeBase
{
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
get
{
return AssemblyName.EscapeCodeBase(CodeBase);
}
}
public virtual AssemblyName GetName()
{
return GetName(false);
}
public virtual AssemblyName GetName(bool copiedName)
{
throw new NotImplementedException();
}
#if FEATURE_APTCA
// This method is called from the VM when creating conditional APTCA exceptions, in order to include
// the text which must be added to the partial trust visible assembly list
[SecurityCritical]
[PermissionSet(SecurityAction.Assert, Unrestricted = true)]
private string GetNameForConditionalAptca()
{
AssemblyName assemblyName = GetName();
return assemblyName.GetNameWithPublicKey();
}
#endif // FEATURE_APTCA
public virtual String FullName
{
get
{
throw new NotImplementedException();
}
}
public virtual MethodInfo EntryPoint
{
get
{
throw new NotImplementedException();
}
}
Type _Assembly.GetType()
{
return base.GetType();
}
public virtual Type GetType(String name)
{
return GetType(name, false, false);
}
public virtual Type GetType(String name, bool throwOnError)
{
return GetType(name, throwOnError, false);
}
public virtual Type GetType(String name, bool throwOnError, bool ignoreCase)
{
throw new NotImplementedException();
}
public virtual Type[] GetExportedTypes()
{
throw new NotImplementedException();
}
[ResourceExposure(ResourceScope.None)]
[ResourceConsumption(ResourceScope.Machine | ResourceScope.Assembly, ResourceScope.Machine | ResourceScope.Assembly)]
public virtual Type[] GetTypes()
{
Module[] m = GetModules(false);
int iNumModules = m.Length;
int iFinalLength = 0;
Type[][] ModuleTypes = new Type[iNumModules][];
for (int i = 0; i < iNumModules; i++)
{
ModuleTypes[i] = m[i].GetTypes();
iFinalLength += ModuleTypes[i].Length;
}
int iCurrent = 0;
Type[] ret = new Type[iFinalLength];
for (int i = 0; i < iNumModules; i++)
{
int iLength = ModuleTypes[i].Length;
Array.Copy(ModuleTypes[i], 0, ret, iCurrent, iLength);
iCurrent += iLength;
}
return ret;
}
// Load a resource based on the NameSpace of the type.
public virtual Stream GetManifestResourceStream(Type type, String name)
{
throw new NotImplementedException();
}
public virtual Stream GetManifestResourceStream(String name)
{
throw new NotImplementedException();
}
public virtual Assembly GetSatelliteAssembly(CultureInfo culture)
{
throw new NotImplementedException();
}
// Useful for binding to a very specific version of a satellite assembly
public virtual Assembly GetSatelliteAssembly(CultureInfo culture, Version version)
{
throw new NotImplementedException();
}
#if FEATURE_CAS_POLICY
public virtual Evidence Evidence
{
get
{
throw new NotImplementedException();
}
}
public virtual PermissionSet PermissionSet
{
// SecurityCritical because permissions can contain sensitive information such as paths
[SecurityCritical]
get
{
throw new NotImplementedException();
}
}
public bool IsFullyTrusted
{
[SecuritySafeCritical]
get
{
return PermissionSet.IsUnrestricted();
}
}
public virtual SecurityRuleSet SecurityRuleSet
{
get
{
throw new NotImplementedException();
}
}
#endif // FEATURE_CAS_POLICY
// ISerializable implementation
[System.Security.SecurityCritical] // auto-generated_required
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
throw new NotImplementedException();
}
[ComVisible(false)]
public virtual Module ManifestModule
{
get
{
// This API was made virtual in V4. Code compiled against V2 might use
// "call" rather than "callvirt" to call it.
// This makes sure those code still works.
RuntimeAssembly rtAssembly = this as RuntimeAssembly;
if (rtAssembly != null)
return rtAssembly.ManifestModule;
throw new NotImplementedException();
}
}
public virtual Object[] GetCustomAttributes(bool inherit)
{
Contract.Ensures(Contract.Result