예제 #1
0
        private void PopulateActivityDelegates(ModelItem modelItem)
        {
            if (this.ActivityDelegates == null)
            {
                this.ActivityDelegates = new ObservableCollection <ActivityDelegateInfo>();
            }
            else
            {
                this.ActivityDelegates.Clear();
            }

            List <ActivityDelegateInfo> list = ActivityDelegateUtilities.CreateActivityDelegateInfo(modelItem);

            if (list.Count > 0)
            {
                foreach (ActivityDelegateInfo entry in list)
                {
                    this.ActivityDelegates.Add(entry);
                }

                this.HasActivityDelegates = true;
            }
            else
            {
                this.HasActivityDelegates = false;
            }
        }
예제 #2
0
        public ActivityDelegate Create()
        {
            ActivityDelegate         delegateObject = Activator.CreateInstance(this.DelegateType) as ActivityDelegate;
            ActivityDelegateMetadata metadata       = ActivityDelegateUtilities.GetMetadata(this.DelegateType);

            ActivityDelegateUtilities.FillDelegate(delegateObject, metadata);
            return(delegateObject);
        }
        private void OnActivityDelegateChanged()
        {
            this.Arguments.Clear();

            if (this.ActivityDelegate != null)
            {
                ActivityDelegateMetadata metadata = ActivityDelegateUtilities.GetMetadata(this.ActivityDelegate.ItemType);

                foreach (ActivityDelegateArgumentMetadata argument in metadata)
                {
                    this.Arguments.Add(this.ActivityDelegate.Properties[argument.Name].Value);
                }

                this.isSetInternally = true;
                this.Handler         = this.ActivityDelegate.Properties["Handler"].Value;
                this.isSetInternally = false;
            }
            else
            {
                this.isSetInternally = true;
                this.Handler         = null;
                this.isSetInternally = false;
            }
        }