Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the SelectPrintContentHelper class.
        /// </summary>
        /// <param name="designerView">workflow designer view</param>
        /// <param name="zoomFactor">zoom factor of workflow designer</param>
        /// <param name="rootActivityDesigner">the root activity designer</param>
        public SelectPrintContentHelper(FrameworkElement designerView, double zoomFactor, ActivityDesigner rootActivityDesigner)
        {
            Contract.Requires(designerView != null);
            Contract.Requires(rootActivityDesigner != null);

            this.designerView = designerView;
            this.zoomFactor = zoomFactor;
            this.rootActivityDesigner = rootActivityDesigner;
        }
        public static Visibility GetExpandCollapseButtonVisibility(WorkflowViewElement viewElement)
        {
            ActivityDesigner designer     = viewElement as ActivityDesigner;
            bool             hasDelegates = (designer != null) && designer.HasActivityDelegates;

            Visibility visibility = Visibility.Visible;

            if (viewElement == null || viewElement.IsRootDesigner || viewElement.DoesParentAlwaysExpandChild() ||
                viewElement.DoesParentAlwaysCollapseChildren() || (viewElement.Content == null && !hasDelegates) ||
                !viewElement.Collapsible || !(viewElement is ActivityDesigner))
            {
                visibility = Visibility.Collapsed;
            }
            return(visibility);
        }
Exemplo n.º 3
0
 private Selection IsInSection(Rect selection, ActivityDesigner designer)
 {
     Rect activityDesignerRect = this.GetActivityDesignerRect(designer);
     if (selection.Contains(activityDesignerRect))
     {
         return Selection.In;
     }
     else if (selection.IntersectsWith(activityDesignerRect))
     {
         return Selection.Intersect;
     }
     else
     {
         return Selection.Out;
     }
 }
Exemplo n.º 4
0
        private Rect GetActivityDesignerRect(ActivityDesigner designer)
        {
            Point offset = GetRelativeOffset(designer, this.designerView);
            double designerWidth = this.GetActualSize(designer.ActualWidth);
            double designerHeight = this.GetActualSize(designer.ActualHeight);

            return new Rect(offset, new Size(designerWidth, designerHeight));
        }
Exemplo n.º 5
0
 private void FilterActivityDesigners(ActivityDesigner rootDesigner, List<ActivityDesigner> foundItems, Rect selection)
 {
     Selection sel = this.IsInSection(selection, rootDesigner);
     if (sel == Selection.In)
     {
         foundItems.Add(rootDesigner);
     }
     else if (sel == Selection.Intersect)
     {
         IEnumerable<DependencyObject> subDesigners = SearchDependencyObjects(rootDesigner, typeof(ActivityDesigner));
         if (subDesigners.Any())
         {
             foreach (var sub in subDesigners)
             {
                 this.FilterActivityDesigners((ActivityDesigner)sub, foundItems, selection);
             }
         }
     }
 }
Exemplo n.º 6
0
        private static bool Load(FrameworkElement element)
        {
            workflowItem = LoadWorkflowItem(element);
            designerView = LoadDeignerView(element);

            AdornerDecorator decorator = LoadAdornerDecorator(element);
            workflowView  = LoadWorkflowView(decorator);
            RegisterWorkflowViewEvents(workflowView);

            scrollViewer = LoadScrollViewer(decorator);
            RegisterScrollViewChanged(scrollViewer);

            workflowViewMask = CreateWorkflowViewMask(workflowView);
            closeButton = CreateCloseButton(workflowView);
            rootActivityDesigner = LoadRootActivityDesigner(workflowView);

            if (rootActivityDesigner == null)
            {
                AddInMessageBoxService.PrintNoneActivityMessage();
                ExitPrint();
                return false;
            }

            return true;
        }