Ejemplo n.º 1
0
        public static HashSet<Type> GetReferencedTypes(WorkflowDesigner workflowDesigner)
        {
            HashSet<Type> referencedTypes = new HashSet<Type>();
            ModelService modelService = workflowDesigner.GetModelService();
            //Get types used in the activities of the workflow
            referencedTypes.UnionWith(modelService.Find(modelService.Root, typeof(object)).Select(item => item.GetCurrentValue().GetType()));

            //Add types referenced in the root (e.g. parameters) to the collection
            ActivityBuilder builder = modelService.Root.GetCurrentValue() as ActivityBuilder;

            if (builder != null)
            {
                referencedTypes.UnionWith(builder.Properties.Select(property => property.Type));
            }

            //Add base types and types of the parameters of every type in the list
            referencedTypes.UnionWith(GetBaseAndArgumentTypes(referencedTypes));

            return referencedTypes;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get subordinate model items
        /// </summary>
        public static IEnumerable<ModelItem> GetSubModelItems(WorkflowDesigner wd)
        {
            Contract.Requires(wd != null);

            return GetSubModelItems(wd.GetModelService(), null);
        }