T GetComboEnum( Sandbox.StringToken& k, T& defaultValue )

book_4_sparkGenerated
code_blocksInput

Description

The GetComboEnum<T> method in the RenderAttributes class is used to retrieve a value of an enumerated type T associated with a specific key. If the key does not exist, it returns a default value provided by the caller.

Usage

To use the GetComboEnum<T> method, you need to provide a StringToken that represents the key and a reference to a default value of type T. The method will return the value associated with the key if it exists; otherwise, it will return the default value.

Example

RenderAttributes renderAttributes = new RenderAttributes();
StringToken key = new StringToken("exampleKey");
MyEnum defaultValue = MyEnum.DefaultValue;
MyEnum result = renderAttributes.GetComboEnum(key, ref defaultValue);

// Assuming MyEnum is defined as:
// enum MyEnum { DefaultValue, Option1, Option2 }