KeyGestureConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) 方法

定義

使用指定的內容,嘗試將指定的物件轉換為 KeyGestureAttempts to convert the specified object to a KeyGesture, using the specified context.

public:
 override System::Object ^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ source);
public override object ConvertFrom (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object source);
override this.ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -> obj
Public Overrides Function ConvertFrom (context As ITypeDescriptorContext, culture As CultureInfo, source As Object) As Object

參數

context
ITypeDescriptorContext

格式內容,提供正在叫用此轉換器之環境的相關資訊。A format context that provides information about the environment from which this converter is being invoked.

culture
CultureInfo

特定文化特性 (Culture) 資訊。Culture specific information.

source
Object

要轉換的物件。The object to convert.

傳回

轉換的物件。The converted object.

例外狀況

無法轉換 sourcesource cannot be converted.

備註

會使用 "+" 索引鍵做為輔助按鍵與索引鍵之間的分隔符號, 以轉換為和。KeyGestureConverter StringThe KeyGestureConverter converts to and from a String using the "+" key as the delimiter between the modifier keys and the key. 例如Control+A , 字串會轉換KeyGesture為, ControlModifiers屬性等於, 且Key屬性等於AFor example, the string Control+A would be converted into a KeyGesture with a Modifiers property equal to Control and Key property equal to A.

適用於