Beispiel #1
0
 internal static IList <CustomAttributeData> GetCustomAttributesInternal(RuntimeModule target)
 {
     if (target.IsResource())
     {
         return(new List <CustomAttributeData>());
     }
     return(CustomAttributeData.GetCustomAttributes(target, target.MetadataToken));
 }
Beispiel #2
0
        public virtual bool IsResource()
        {
            RuntimeModule module = this as RuntimeModule;

            if (module == null)
            {
                throw new NotImplementedException();
            }
            return(module.IsResource());
        }
Beispiel #3
0
        /// <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();
        }
Beispiel #4
0
        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));
        }
Beispiel #5
0
        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();
        }
Beispiel #6
0
 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);
 }
Beispiel #8
0
        [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);
        }