Behavior 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 Behavior 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| Behavior() |
初始化 Behavior 類別的新執行個體。 |
| Behavior(Boolean, BehaviorService) |
初始化該類別的新實例 Behavior ,給定 BehaviorService。 |
Behavior()
- 來源:
- Behavior.cs
- 來源:
- Behavior.cs
- 來源:
- Behavior.cs
- 來源:
- Behavior.cs
- 來源:
- Behavior.cs
初始化 Behavior 類別的新執行個體。
protected:
Behavior();
protected Behavior();
Protected Sub New ()
範例
以下程式碼範例示範如何初始化該 Behavior 類別的新實例。 此程式碼範例是本類別更大範例 BehaviorService 的一部分。
public:
DemoGlyph(BehaviorService^ behavior, Control^ control):
Glyph(gcnew BehaviorServiceSample::DemoBehavior)
{
this->behavior = behavior;
this->control = control;
}
public MyGlyph(BehaviorService behaviorSvc, Control control) :
base(new MyBehavior())
{
this.behaviorSvc = behaviorSvc;
this.control = control;
}
Public Sub New(ByVal behaviorSvc As _
System.Windows.Forms.Design.Behavior.BehaviorService, _
ByVal control As Control)
MyBase.New(New MyBehavior())
Me.behaviorSvc = behaviorSvc
Me.control = control
End Sub
另請參閱
適用於
Behavior(Boolean, BehaviorService)
- 來源:
- Behavior.cs
- 來源:
- Behavior.cs
- 來源:
- Behavior.cs
- 來源:
- Behavior.cs
- 來源:
- Behavior.cs
初始化該類別的新實例 Behavior ,給定 BehaviorService。
protected:
Behavior(bool callParentBehavior, System::Windows::Forms::Design::Behavior::BehaviorService ^ behaviorService);
protected Behavior(bool callParentBehavior, System.Windows.Forms.Design.Behavior.BehaviorService behaviorService);
protected Behavior(bool callParentBehavior, System.Windows.Forms.Design.Behavior.BehaviorService? behaviorService);
new System.Windows.Forms.Design.Behavior.Behavior : bool * System.Windows.Forms.Design.Behavior.BehaviorService -> System.Windows.Forms.Design.Behavior.Behavior
Protected Sub New (callParentBehavior As Boolean, behaviorService As BehaviorService)
參數
- callParentBehavior
- Boolean
true若父行為存在,是否應被呼叫;否則,。 false
- behaviorService
- BehaviorService
例外狀況
callParentBehavior 是 true,behaviorService 是 null。
備註
父行為是由 BehaviorService維護的行為堆疊上的下一個行為。 若參數 callParentBehavior 為 true,則該 behaviorService 參數必非 null。
callParentBehavior 表示基底 Behavior 類別是否應呼叫父行為,然後允許選擇 BehaviorService 正確的父行為。