ResourceLoader 建構函式

定義

多載

ResourceLoader()

注意

ResourceLoader () 可能會在Windows 8.1之後變更或無法使用版本。 請改用 GetForCurrentView ()

建構目前執行中應用程式主要ResourceMap之 「Resources」 子樹的新ResourceLoader物件。

適用于 UWP 的對等 WinUI 2 API:Windows 應用程式 SDK中 WinUI的 ResourceLoader () (,請參閱Windows 應用程式 SDK命名空間) 。

ResourceLoader(String)

注意

ResourceLoader (String) 可能會在Windows 8.1之後變更或無法使用。 請改用 GetForCurrentView (String)

為指定的ResourceMap建構新的ResourceLoader物件。

適用于 UWP 的對等 WinUI 2 APIResourceLoader (String) (for WinUI Windows 應用程式 SDK,請參閱Windows 應用程式 SDK命名空間) 。

ResourceLoader()

注意

ResourceLoader () 可能會在Windows 8.1之後變更或無法使用版本。 請改用 GetForCurrentView ()

建構目前執行中應用程式主要ResourceMap之 「Resources」 子樹的新ResourceLoader物件。

適用于 UWP 的對等 WinUI 2 API:Windows 應用程式 SDK中 WinUI的 ResourceLoader () (,請參閱Windows 應用程式 SDK命名空間) 。

public:
 ResourceLoader();
 ResourceLoader();
public ResourceLoader();
function ResourceLoader()
Public Sub New ()

備註

空建構函式通常允許存取資源檔的具名資源, (resources.resjson 或 resources.resw) 。

如果主要 ResourceMap 沒有 「Resources」 子樹,此建構函式就會失敗,但發生例外狀況。

另請參閱

適用於

ResourceLoader(String)

注意

ResourceLoader (String) 可能會在Windows 8.1之後變更或無法使用。 請改用 GetForCurrentView (String)

為指定的ResourceMap建構新的ResourceLoader物件。

適用于 UWP 的對等 WinUI 2 APIResourceLoader (String) (for WinUI Windows 應用程式 SDK,請參閱Windows 應用程式 SDK命名空間) 。

public:
 ResourceLoader(Platform::String ^ name);
/// [Windows.Foundation.Metadata.Deprecated("ResourceLoader may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
 ResourceLoader(winrt::hstring const& name);
/// [Windows.Foundation.Metadata.Deprecated("ResourceLoader may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
 ResourceLoader(winrt::hstring const& name);
 ResourceLoader(winrt::hstring const& name);
[Windows.Foundation.Metadata.Deprecated("ResourceLoader may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
public ResourceLoader(string name);
[Windows.Foundation.Metadata.Deprecated("ResourceLoader may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public ResourceLoader(string name);
public ResourceLoader(string name);
function ResourceLoader(name)
Public Sub New (name As String)

參數

name
String

Platform::String

winrt::hstring

新資源載入器用於未限定資源參考之 ResourceMap 的資源識別碼。 然後,它可以擷取相對於這些參考的資源。

注意

資源識別碼會被視為統一資源識別項 (URI) 片段,受限於統一資源識別項 (URI) 語意。 例如,「Caption%20」 被視為 「Caption 」。 請勿在資源識別碼中使用 「?」 或 「#」,因為它們會終止具名資源路徑。 例如,「Foo?3」 被視為 「Foo」。

屬性

備註

這個建構函式通常用來存取相對於具有指定資源識別碼的資源檔。 例如, new ResourceLoader('Errors'); 相對於 errors.resjson 或 errors.resw。

另請參閱

適用於