Click or drag to resize
KeyStringValueAttribute Class
This attribute is used to represent a string value of an enum elements. Unlike StringValueAttribute, this attribute can be used multiple times. Which attribute should be used will be specified by key. Key can't be generic (C# limitation) nor Enum (Attribute params can not be dynamic). Thus it is int.
Inheritance Hierarchy

Namespace: CMS.Chat
Assembly: CMS.Chat (in CMS.Chat.dll) Version: 12.0.0
Syntax
C#
public class KeyStringValueAttribute : StringValueAttribute

The KeyStringValueAttribute type exposes the following members.

Constructors
  NameDescription
Public methodKeyStringValueAttribute
Constructor.
Top
Properties
  NameDescription
Public propertyIsResourceString
If set to true, StringValue is resolved by ResHelper before returning.
(Inherited from StringValueAttribute.)
Public propertyKey
Gets or sets Key of this attribute. This key is used later to lookup this attribute in method ToStringValue().
Public propertyStringValue
Holds the stringvalue for a value in an enum.
(Inherited from StringValueAttribute.)
Top
Methods
  NameDescription
Public methodToString
Gets string representation (the same as StringValue).
(Inherited from StringValueAttribute.)
Top
Examples
enum XXX { [KeyStringValue((int)ChatMessageTypeStringValueUsageEnum.CMSDeskDescription, "chat.system.cmsdesk.leaveroom", IsResourceString = true)] [KeyStringValue((int)ChatMessageTypeStringValueUsageEnum.LiveSiteMessage, "chat.system.userhasleftroom")] LeaveRoom = 2, } XXX.LeaveRoom.ToStringValue((int)ChatMessageTypeStringValueUsageEnum.CMSDeskDescription);
See Also