HypernovaDesktop Components · docs
Binarymission
WinForms › Smart Button › ContextMenuPropertiesTypeConverter

ContextMenuPropertiesTypeConverter

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.ButtonControls

A type converter that lets the Properties window expand an object into its individual properties.

public class ContextMenuPropertiesTypeConverter : System.ComponentModel.ExpandableObjectConverter

Inherits from / implements: System.ComponentModel.ExpandableObjectConverter

Remarks

Part of this assembly for compatibility with the .NET Framework edition of SmartButton, where it lets the drop-down menu's drawing settings be edited in the Properties window. Apply it with TypeConverterAttribute to a settings class of your own for the same expandable editing.

Examples

[TypeConverter(typeof(ContextMenuPropertiesTypeConverter))]
public class PrintSettings
{
    public bool Landscape { get; set; }
    public int Copies { get; set; } = 1;
}

Members at a glance

Methods
GetPropertiesGets the properties of value to show beneath it in the Properties window.
GetPropertiesSupportedTells the Properties window that the object can be expanded.

Methods

GetProperties

public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)

Gets the properties of value to show beneath it in the Properties window.

Parameters
context
The context the Properties window supplies; not used.
value
The object being edited.
attributes
The attributes a property must have to be included, or null for all.
Returns

The public properties of value that carry attributes.

GetPropertiesSupported

public override bool GetPropertiesSupported(ITypeDescriptorContext context)

Tells the Properties window that the object can be expanded.

Parameters
context
The context the Properties window supplies; not used.
Returns

Always true.