SaaS CMS has officially launched! Learn more now.

Class MenuAttributeBase

Base class for attributes that builds up the navigation.

Inheritance
System.Object
System.Attribute
MenuAttributeBase
Implements
System.Runtime.InteropServices._Attribute
Inherited Members
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.Equals(System.Object)
System.Attribute.GetHashCode()
System.Attribute.Match(System.Object)
System.Attribute.IsDefaultAttribute()
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfoCount(System.UInt32)
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfo(System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.GetIDsOfNames(System.Guid, System.IntPtr, System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.Invoke(System.UInt32, System.Guid, System.UInt32, System.Int16, System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr)
System.Attribute.TypeId
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Shell.Navigation
Assembly: EPiServer.Shell.dll
Version: 10.10.4
Syntax
public abstract class MenuAttributeBase : Attribute, _Attribute

Constructors

MenuAttributeBase(String)

Initializes a new instance of the MenuAttributeBase class.

Declaration
protected MenuAttributeBase(string menuPath)
Parameters
Type Name Description
System.String menuPath

The unique path of the menu item.

Properties

MenuPath

Unique path for the menu item

Declaration
public string MenuPath { get; protected set; }
Property Value
Type Description
System.String
Examples

/top/forum/search

ResourceType

The strongly typed resource wrapper to use for resource string lookups

Declaration
public Type ResourceType { get; set; }
Property Value
Type Description
System.Type
Remarks

If not set the Current will be used to find a match for TextResourceKey.

SortIndex

An index for ordering menu items. See SortIndex values for predefined values.

Declaration
public int SortIndex { get; set; }
Property Value
Type Description
System.Int32

Text

Text to display in the menu

Declaration
public string Text { get; set; }
Property Value
Type Description
System.String

TextResourceKey

Name of a resource key to use for localized menu text

Declaration
public string TextResourceKey { get; set; }
Property Value
Type Description
System.String
Remarks

This can either be a resource key to a resource provided by Current or the name of the static resource wrapper property if ResourceType is set.

Methods

GetLocalizedText(String, String)

Gets the localized text or the fallback text if no localized text is found.

Declaration
public virtual string GetLocalizedText(string resourceKey, string fallbackText)
Parameters
Type Name Description
System.String resourceKey

The resource key.

System.String fallbackText

The fallback text.

Returns
Type Description
System.String
Remarks

This uses the static instance Current if ResourceType is null.

GetLocalizedText(String, String, LocalizationService)

Gets the localized text or the fallback text if no localized text is found.

Declaration
public virtual string GetLocalizedText(string resourceKey, string fallbackText, LocalizationService localizationService)
Parameters
Type Name Description
System.String resourceKey

The resource key.

System.String fallbackText

The fallback text.

LocalizationService localizationService

The service used for localization.

Returns
Type Description
System.String

Implements

System.Runtime.InteropServices._Attribute

Extension Methods