ResourceManager.InternalGetResourceSet(CultureInfo, Boolean, Boolean) 方法

定义

提供用于查找资源集的实现。Provides the implementation for finding a resource set.

protected:
 virtual System::Resources::ResourceSet ^ InternalGetResourceSet(System::Globalization::CultureInfo ^ culture, bool createIfNotExists, bool tryParents);
protected virtual System.Resources.ResourceSet InternalGetResourceSet (System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents);
abstract member InternalGetResourceSet : System.Globalization.CultureInfo * bool * bool -> System.Resources.ResourceSet
override this.InternalGetResourceSet : System.Globalization.CultureInfo * bool * bool -> System.Resources.ResourceSet
Protected Overridable Function InternalGetResourceSet (culture As CultureInfo, createIfNotExists As Boolean, tryParents As Boolean) As ResourceSet

参数

culture
CultureInfo

要查找的区域性对象。The culture object to look for.

createIfNotExists
Boolean

如果尚未加载,true 要加载资源集;否则为 falsetrue to load the resource set, if it has not been loaded yet; otherwise, false.

tryParents
Boolean

要在无法加载资源集时检查父 CultureInfo 对象,则为 true;否则为 falsetrue to check parent CultureInfo objects if the resource set cannot be loaded; otherwise, false.

返回

指定的资源集。The specified resource set.

异常

主程序集不包含 .resources 文件,但查找资源需要此文件。The main assembly does not contain a .resources file, which is required to look up a resource.

运行时中存在内部错误。There was an internal error in the runtime.

未能定位与 culture 关联的附属程序集。The satellite assembly associated with culture could not be located.

继承者说明

此方法完成查找资源集所需的所有工作,可以是递归和可重入的。This method completes all the work necessary to find a resource set, and can be recursive and reentrant. 换言之,此方法可能会加载一个程序集,并触发AssemblyLoad一个事件,该事件随后回调ResourceManager到尚未完全初始化的对象。In other words, this method might load an assembly and trigger an AssemblyLoad event, which then calls back into a ResourceManager object that has not been completely initialized. 若要避免额外锁定,此方法不是线程安全的。To avoid taking extra locks, this method is not thread safe. GetResourceSet(CultureInfo, Boolean, Boolean)、和方法GetObject(String)执行所有必要的同步。 GetString(String)The GetResourceSet(CultureInfo, Boolean, Boolean), GetString(String), and GetObject(String) methods do all the necessary synchronization.

安全性

ReflectionPermission
当通过诸如InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])等机制后期绑定调用时。when invoked late-bound through mechanisms such as InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]). 关联枚举:MemberAccessAssociated enumeration: MemberAccess.

适用于

另请参阅