internal static IList <CustomAttributeData> GetCustomAttributesInternal(RuntimeModule target) { if (target.IsResource()) { return(new List <CustomAttributeData>()); } return(CustomAttributeData.GetCustomAttributes(target, target.MetadataToken)); }
public virtual bool IsResource() { RuntimeModule module = this as RuntimeModule; if (module == null) { throw new NotImplementedException(); } return(module.IsResource()); }
/// <summary>获取一个值,该值指示此对象是否是资源。</summary> /// <returns>如果此对象是资源,则为 true;否则为 false。</returns> public virtual bool IsResource() { RuntimeModule runtimeModule = this as RuntimeModule; if ((Module)runtimeModule != (Module)null) { return(runtimeModule.IsResource()); } throw new NotImplementedException(); }
internal static IList <CustomAttributeData> GetCustomAttributesInternal(RuntimeModule target) { if (target.IsResource()) { return((IList <CustomAttributeData>) new List <CustomAttributeData>()); } RuntimeModule module = target; int metadataToken = module.MetadataToken; return(CustomAttributeData.GetCustomAttributes(module, metadataToken)); }
public virtual bool IsResource() { // 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. RuntimeModule rtModule = this as RuntimeModule; if (rtModule != null) { return(rtModule.IsResource()); } throw new NotImplementedException(); }
public override bool IsResource() { return(RuntimeModule.IsResource(this.GetNativeHandle())); }
internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeModule target) { if (target.IsResource()) { return new List<CustomAttributeData>(); } return GetCustomAttributes(target, target.MetadataToken); }
[System.Security.SecuritySafeCritical] // auto-generated internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeModule target) { Contract.Assert(target != null); if (target.IsResource()) return new List<CustomAttributeData>(); return GetCustomAttributes(target, target.MetadataToken); }