예제 #1
0
        protected override void Initialize(Activity activity)
        {
            base.Initialize(activity);
            this.ShowPreview = true;
            CompositeActivity activity2 = base.Activity as CompositeActivity;

            if (activity2 != null)
            {
                foreach (Activity activity3 in activity2.Activities)
                {
                    if (!Helpers.IsAlternateFlowActivity(activity3))
                    {
                        System.Workflow.ComponentModel.Design.ItemInfo item = new System.Workflow.ComponentModel.Design.ItemInfo(activity3.GetHashCode());
                        item.UserData[DesignerUserDataKeys.Activity] = activity3;
                        this.previewStrip.Items.Add(item);
                    }
                }
            }
            ISelectionService service = base.GetService(typeof(ISelectionService)) as ISelectionService;

            if (service != null)
            {
                service.SelectionChanged += new EventHandler(this.OnSelectionChanged);
            }
        }
예제 #2
0
        protected override void Initialize(Activity activity)
        {
            base.Initialize(activity);

            ShowPreview = true;

            CompositeActivity compositeActivity = Activity as CompositeActivity;

            if (compositeActivity != null)
            {
                foreach (Activity containedActivity in compositeActivity.Activities)
                {
                    if (!Helpers.IsAlternateFlowActivity(containedActivity))
                    {
                        ItemInfo stripItem = new ItemInfo(containedActivity.GetHashCode());
                        stripItem.UserData[DesignerUserDataKeys.Activity] = containedActivity;
                        this.previewStrip.Items.Add(stripItem);
                    }
                }
            }

            //Start listening to selection change event
            ISelectionService selectionService = GetService(typeof(ISelectionService)) as ISelectionService;

            if (selectionService != null)
            {
                selectionService.SelectionChanged += new EventHandler(OnSelectionChanged);
            }
        }
예제 #3
0
 protected override void OnContainedActivitiesChanged(ActivityCollectionChangeEventArgs listChangeArgs)
 {
     if (base.ActiveDesigner == this)
     {
         if (((listChangeArgs.Action == ActivityCollectionChangeAction.Add) && (listChangeArgs.AddedItems.Count > 0)) && !Helpers.IsAlternateFlowActivity(listChangeArgs.AddedItems[0]))
         {
             System.Workflow.ComponentModel.Design.ItemInfo item = new System.Workflow.ComponentModel.Design.ItemInfo(listChangeArgs.AddedItems[0].GetHashCode());
             item.UserData[DesignerUserDataKeys.Activity] = listChangeArgs.AddedItems[0];
             if (listChangeArgs.Index < this.previewStrip.Items.Count)
             {
                 this.previewStrip.Items.Insert(listChangeArgs.Index, item);
             }
             else
             {
                 this.previewStrip.Items.Add(item);
             }
         }
         else if ((listChangeArgs.Action == ActivityCollectionChangeAction.Remove) && (listChangeArgs.RemovedItems.Count > 0))
         {
             int index = this.previewStrip.Items.IndexOf(new System.Workflow.ComponentModel.Design.ItemInfo(listChangeArgs.RemovedItems[0].GetHashCode()));
             if (index >= 0)
             {
                 this.previewStrip.Items.RemoveAt(index);
             }
         }
     }
     base.OnContainedActivitiesChanged(listChangeArgs);
 }