KeyGestureFormatInfo Class
Definition
Provides platform specific formatting information for the KeyGesture class
public class KeyGestureFormatInfo
Constructors
| Name | Description |
|---|---|
| KeyGestureFormatInfo | No summary available. |
KeyGestureFormatInfo Constructor
public KeyGestureFormatInfo(System.Collections.Generic.IReadOnlyDictionary<Avalonia.Input.Key, string> platformKeyOverrides, string meta, string ctrl, string alt, string shift)
Parameters
platformKeyOverrides System.Collections.Generic.IReadOnlyDictionary<Avalonia.Input.Key, string>
meta string
ctrl string
alt string
shift string
Methods
| Name | Description |
|---|---|
| FormatKey | Checks the platformKeyOverrides and s_commonKeyOverrides Dictionaries, in order, for the appropriate string to represent the given Key on this platform. NOTE: If platformKeyOverrides is null, this is assumed to be the Invariant and the Dictionaries are not checked. The plain Enum string is returned instead. |
| GetFormat | No summary available. |
| GetInstance | Gets the most appropriate KeyGestureFormatInfo for the IFormatProvider requested. This will be, in order: 1. The provided IFormatProvider as a KeyGestureFormatInfo 2. The currently registered platform specific KeyGestureFormatInfo, if present. 3. The Invariant otherwise. |
FormatKey Method
Checks the platformKeyOverrides and s_commonKeyOverrides Dictionaries, in order, for the appropriate string to represent the given Key on this platform. NOTE: If platformKeyOverrides is null, this is assumed to be the Invariant and the Dictionaries are not checked. The plain Enum string is returned instead.
public string FormatKey(Avalonia.Input.Key key)
Parameters
The Key to format.
Returns
string
The appropriate platform specific or common override if present, key.ToString() if not or this is the Invariant.
GetFormat Method
public object GetFormat(Type formatType)
Parameters
formatType Type
Returns
object
GetInstance Method
Gets the most appropriate KeyGestureFormatInfo for the IFormatProvider requested. This will be, in order:
- The provided IFormatProvider as a KeyGestureFormatInfo
- The currently registered platform specific KeyGestureFormatInfo, if present.
- The Invariant otherwise.
public Avalonia.Input.Platform.KeyGestureFormatInfo GetInstance(IFormatProvider formatProvider)
Parameters
formatProvider IFormatProvider
The IFormatProvider to get a KeyGestureFormatInfo for.
Returns
Properties
| Name | Description |
|---|---|
| Alt | The string used to represent Alt on the appropriate platform. Defaults to "Alt". |
| Ctrl | The string used to represent Ctrl on the appropriate platform. Defaults to "Ctrl". |
| Invariant | The Invariant format. Only uses strings straight from the appropriate Enums. |
| Meta | The string used to represent Meta on the appropriate platform. Defaults to "Cmd". |
| Shift | The string used to represent Shift on the appropriate platform. Defaults to "Shift". |
Alt Property
The string used to represent Alt on the appropriate platform. Defaults to "Alt".
public string Alt { get; set; }
Ctrl Property
The string used to represent Ctrl on the appropriate platform. Defaults to "Ctrl".
public string Ctrl { get; set; }
Invariant Property
The Invariant format. Only uses strings straight from the appropriate Enums.
public Avalonia.Input.Platform.KeyGestureFormatInfo Invariant { get; set; }
Meta Property
The string used to represent Meta on the appropriate platform. Defaults to "Cmd".
public string Meta { get; set; }
Shift Property
The string used to represent Shift on the appropriate platform. Defaults to "Shift".
public string Shift { get; set; }