SiteMapNode.GetImplicitResourceString(String) 方法

定义

获取一个本地化的字符串,此方法基于以下信息:跟踪 SiteMapNodeSiteMapProvider 所指定的特性名称和 ResourceKey 属性。Gets a localized string based on the attribute name and ResourceKey property that is specified by the SiteMapProvider by which the SiteMapNode is tracked.

protected:
 System::String ^ GetImplicitResourceString(System::String ^ attributeName);
protected string GetImplicitResourceString (string attributeName);
member this.GetImplicitResourceString : string -> string
Protected Function GetImplicitResourceString (attributeName As String) As String

参数

attributeName
String

要本地化的 SiteMapNode 特性。The SiteMapNode attribute to localize.

返回

String

表示本地化特性的字符串。A string representing the localized attribute. 默认值为 nullThe default is null.

例外

attributeNamenullattributeName is null.

注解

GetImplicitResourceString方法是在属性的 get 访问器 TitleDescription 属性以及在属性中定义的任何自定义属性的 get 访问器中调用的 AttributesThe GetImplicitResourceString method is invoked in the get accessor of the Title property, the Description property, and any custom attributes that are defined in the Attributes property. SiteMapProvider跟踪对象的提供程序的 SiteMapNode EnableLocalization 属性必须设置为,才能 true GetImplicitResourceString 调用方法。The SiteMapProvider provider by which the SiteMapNode object is tracked must have its EnableLocalization property set to true for the GetImplicitResourceString method to be called. 如果 EnableLocalization 设置为,则 false 不会执行本地化,也不会 GetImplicitResourceString 调用方法。If the EnableLocalization is set to false, localization is not performed and the GetImplicitResourceString method is never called.

如果该 GetImplicitResourceString 方法返回的字符串不为空,则该字符串将成为 TitleDescription 或自定义特性的值。If the GetImplicitResourceString method returns a string that is not empty, this becomes the value of the Title, Description, or custom attribute property.

GetImplicitResourceString方法使用属性的值 ResourceKey 来本地化特性。The GetImplicitResourceString method uses the value of the ResourceKey property to localize the attribute. 如果 ResourceKey 未指定,则 GetImplicitResourceString 返回 nullIf the ResourceKey is not specified, the GetImplicitResourceString returns null.

备注

XmlSiteMapProvider类对 SiteMapNode 对象不能同时定义特性的隐式资源表达式和显式资源表达式施加限制。The XmlSiteMapProvider class imposes the restriction that the SiteMapNode object cannot define both implicit resource expressions and explicit resource expressions for attributes. 但是,自定义提供程序实现可以选择允许这两种方法。However, a custom provider implementation can choose to allow both.

适用于

另请参阅