NativeActivity 构造函数

定义

在派生类中实现时,创建派生类的新实例。

protected:
 NativeActivity();
protected NativeActivity ();
Protected Sub New ()

示例

下面的代码示例演示如何创建一个从 NativeActivity<TResult> 继承的类。 此示例摘自 使用本机活动的自定义复合 示例。

public sealed class MySequence : NativeActivity
{
    Collection<Activity> children;
    Collection<Variable> variables;
    Variable<int> currentIndex;
    CompletionCallback onChildComplete;

    public MySequence()
        : base()
    {
        this.children = new Collection<Activity>();
        this.variables = new Collection<Variable>();
        this.currentIndex = new Variable<int>();
    }

    public Collection<Activity> Activities
    {
        get
        {
            return this.children;
        }
    }

    public Collection<Variable> Variables
    {
        get
        {
            return this.variables;
        }
    }

适用于