2

保護されたメソッドにアクセスする方法を知りたいです。

多くの保護されたメソッドを持つ WebBrowser コントロール (Awesomium) があります。

WinForm でこの WebControl を使用してタブ付きブラウザーを作成しました。

今は ie InjectKeyboard-method が保護されているため使用できません。

これは方法です:

//     Injects a keyboard event.
//
// Parameter:
//   keyEvent:
//     The keyboard event to inject. You'll need to initialize the members of the
//     passed Awesomium.Core.WebKeyboardEvent, yourself.
//
// Note:
//      Awesomium.Windows.Forms.WebControl handles this internally. Inheritors do
//     not need to call this method unless they implement custom logic.  This method
//     bypasses settings of the Awesomium.Windows.Forms.WebControl.InputController.
//      For performance reasons, no validity check is performed when calling protected
//     members.  Inheritors should perform any such checks (see Awesomium.Windows.Forms.WebControl.IsLive),
//     before calling these members.

protected void InjectKeyboardEvent(WebKeyboardEvent keyEvent);

APIリンクはこちら

彼らがこのメソッドを保護した理由と、その使用方法を教えてください。

4

1 に答える 1

2

このクラスから継承し、必要に応じてメソッドを公開します (メソッドの上のコメントで提案されているように)。

于 2011-12-04T16:49:54.857 に答える