Class EnumDescriptionConverter
Provides a type converter that allows editing properties of enum
type
in the Plugin Settings dialog.
Namespace: VE3NEA.HamCockpit.PluginHelpers
Assembly: VE3NEA.HamCockpit.PluginAPI.dll
Syntax
public class EnumDescriptionConverter : EnumConverter
Remarks
If a property of enum
type in the Settings
object of a plugin needs to be edited
in the Plugin Settings dialog, use this class as a TypeConverter
attribute for that property.
With this attribute, the editor shows the descriptions of enum
values instead of the values themselves.
Examples
Enum values with descriptions:
enum InputType {
[Description("Left Channel")]
LeftChannel,
[Description("Right Channel")]
RightChannel,
[Description("Diversity (stereo)")]
DiversityStereo
}
TypeConverter attribute:
[TypeConverter(typeof(EnumDescriptionConverter))]
public InputType InputType { get; set; }