示例#1
0
        internal bool ShouldAppearOnBreadCrumb(ModelItem modelItem, bool checkIfCanBeMadeRoot)
        {
            bool shouldAppearOnBreadCrumb = false;

            if (modelItem != null)
            {
                Type designerType = this.GetDesignerType(modelItem.ItemType);
                if (null != designerType)
                {
                    if (checkIfCanBeMadeRoot)
                    {
                        ActivityDesignerOptionsAttribute options = WorkflowViewService.GetAttribute <ActivityDesignerOptionsAttribute>(modelItem.ItemType);
                        shouldAppearOnBreadCrumb = (typeof(WorkflowViewElement).IsAssignableFrom(designerType) &&
                                                    (typeof(ActivityDesigner) != designerType || ActivityDelegateUtilities.HasActivityDelegate(modelItem.ItemType)) &&
                                                    typeof(WorkflowService) != designerType &&
                                                    (options == null || options.AllowDrillIn));
                    }
                    else
                    {
                        shouldAppearOnBreadCrumb = typeof(WorkflowViewElement).IsAssignableFrom(designerType);
                    }
                }
            }
            return(shouldAppearOnBreadCrumb);
        }
        private static bool HasView(ModelItem modelItem, WorkflowViewService viewService, bool allowDrillIn)
        {
            ActivityDesignerOptionsAttribute options = WorkflowViewService.GetAttribute <ActivityDesignerOptionsAttribute>(modelItem.ItemType);
            Type viewType = viewService.GetDesignerType(modelItem.ItemType);

            return(typeof(WorkflowViewElement).IsAssignableFrom(viewType) && (!allowDrillIn || options == null || options.AllowDrillIn));
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null || value == DependencyProperty.UnsetValue)
            {
                return(false);
            }

            ActivityDesignerOptionsAttribute attr = WorkflowViewService.GetAttribute <ActivityDesignerOptionsAttribute>(value.GetType());

            return(attr == null || !attr.AlwaysCollapseChildren);
        }
        internal static bool DoesParentAlwaysCollapseChildren(ModelItem modelItem, EditingContext context)
        {
            bool parentAlwaysCollapsesChild = false;
            Type parentDesignerType         = GetParentDesignerType(modelItem, context);

            if (typeof(WorkflowViewElement).IsAssignableFrom(parentDesignerType))
            {
                ActivityDesignerOptionsAttribute options = WorkflowViewService.GetAttribute <ActivityDesignerOptionsAttribute>(parentDesignerType);
                parentAlwaysCollapsesChild = (options != null && options.AlwaysCollapseChildren);
            }
            return(parentAlwaysCollapsesChild);
        }