Beispiel #1
0
        public virtual FieldInfo[] GetFields(BindingFlags bindingFlags)
        {
            RuntimeModule module = this as RuntimeModule;

            if (module == null)
            {
                throw new NotImplementedException();
            }
            return(module.GetFields(bindingFlags));
        }
Beispiel #2
0
        /// <summary>返回在模块中定义的全局字段,这些字段与指定的绑定标志匹配。</summary>
        /// <returns>一个 <see cref="T:System.Reflection.FieldInfo" /> 类型的数组,该类型表示在模块中定义的全局字段,这些字段与指定的绑定标志匹配;如果不存在与这些绑定标志匹配的全局字段,则返回一个空数组。</returns>
        /// <param name="bindingFlags">用来限制搜索的 <see cref="T:System.Reflection.BindingFlags" /> 值的按位组合。</param>
        public virtual FieldInfo[] GetFields(BindingFlags bindingFlags)
        {
            RuntimeModule runtimeModule = this as RuntimeModule;

            if ((Module)runtimeModule != (Module)null)
            {
                return(runtimeModule.GetFields(bindingFlags));
            }
            throw new NotImplementedException();
        }
Beispiel #3
0
        public virtual FieldInfo[] GetFields(BindingFlags bindingFlags)
        {
            // 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.GetFields(bindingFlags));
            }

            throw new NotImplementedException();
        }