Behavior 构造函数

定义

初始化 Behavior 类的新实例。

重载

名称 说明
Behavior()

初始化 Behavior 类的新实例。

Behavior(Boolean, BehaviorService)

使用给定BehaviorService的初始化类的新实例Behavior

Behavior()

Source:
Behavior.cs
Source:
Behavior.cs
Source:
Behavior.cs
Source:
Behavior.cs
Source:
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)

Source:
Behavior.cs
Source:
Behavior.cs
Source:
Behavior.cs
Source:
Behavior.cs
Source:
Behavior.cs

使用给定BehaviorService的初始化类的新实例Behavior

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

要使用的 BehaviorService

例外

callParentBehavior truebehaviorServicenull

注解

父行为是行为堆栈上由 <a0/&a0; 维护的下一个行为。 如果参数callParentBehavior为,则behaviorService参数不得为 nulltrue

callParentBehavior 指示基 Behavior 类是否应调用父行为,然后允许 BehaviorService 选择正确的父行为。

适用于