StructuredCompositeActivityDesigner.ContainedDesigners Özellik

Tanım

öğesinin alt StructuredCompositeActivityDesigneröğeleri olan tüm etkinlik tasarımcılarını içeren genel bir salt okunur koleksiyon alır.

C#
public override System.Collections.ObjectModel.ReadOnlyCollection<System.Workflow.ComponentModel.Design.ActivityDesigner> ContainedDesigners { get; }

Özellik Değeri

ReadOnlyCollection<ActivityDesigner>

ActivityDesigner Alt tasarımcıları içeren salt okunur koleksiyon.

Örnekler

Aşağıdaki örnekte, sınıfını temel alan bir tasarımcı kullanılarak yeni bir dalın eklenmesi gösterilmektedir CompositeActivityDesigner . true döndürürse CanInsertActivities , yöntemi kullanılarak InsertActivities yeni bir dal oluşturulur. ConnectorHitTestInfo Yöntemine InsertActivities parametre olarak bir nesne oluşturulur. Bu tamamlandığında, EnsureVisibleContainedDesigner yeni eklenen dalın koleksiyondaki tek bir nesneye erişerek iş akışı tasarımcısında görüntülenmesini ContainedDesigners sağlamak için yöntemi kullanılır.

C#
protected override CompositeActivity OnCreateNewBranch()
{
    return new ParallelIfBranch();
}

private void OnAddBranch(object sender, EventArgs e)
{
    CompositeActivity activity1 = this.OnCreateNewBranch();
    CompositeActivity activity2 = base.Activity as CompositeActivity;

    if ((activity2 != null) && (activity1 != null))
    {
        int num1 = this.ContainedDesigners.Count;
        Activity[] activityArray1 = new Activity[] { activity1 };

        if (CanInsertActivities(new ConnectorHitTestInfo(this, HitTestLocations.Designer, activity2.Activities.Count),
            new List<Activity>(activityArray1).AsReadOnly()))
        {
            CompositeActivityDesigner.InsertActivities(this,
                new ConnectorHitTestInfo(this, HitTestLocations.Designer, activity2.Activities.Count),
                new List<Activity>(activityArray1).AsReadOnly(),
                string.Format("Adding branch {0}", activity1.GetType().Name));

            if ((this.ContainedDesigners.Count > num1) && (this.ContainedDesigners.Count > 0))
            {
                this.ContainedDesigners[this.ContainedDesigners.Count - 1].EnsureVisible();
            }
        }
    }
}

Şunlara uygulanır

Ürün Sürümler
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8