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: 8.2.23
Syntax
C#
public class KeyStringValueAttribute : StringValueAttribute

The KeyStringValueAttribute type exposes the following members.

Constructors
  NameDescription
Public methodKeyStringValueAttribute
Constructor.
Top
Methods
  NameDescription
Public methodToString
Gets string representation (the same as StringValue).
(Inherited from StringValueAttribute.)
Top
Extension Methods
  NameDescription
Public Extension MethodAsValue
Converts object to a query value which can be used as a query parameter
(Defined by QueryExtensions.)
Public Extension MethodGetAPIString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodToBoolean
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDateTime
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDouble
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToGuid
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToInteger
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToString
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.)
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
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