protected override void OnViewChanged(DesignerView view)
        {
            base.OnViewChanged(view);

            ActivityDesigner hostedDesigner = (ActiveView != null) ? ActiveView.AssociatedDesigner : null;
            if (hostedDesigner.Activity is FaultHandlersActivity)
            {
                Header.Text = DR.GetString(DR.WorkflowExceptions);
                HelpText = String.Empty;
            }
            else if (hostedDesigner.Activity is EventHandlersActivity)
            {
                Header.Text = DR.GetString(DR.WorkflowEvents);
                HelpText = String.Empty;
            }
            else if (hostedDesigner.Activity is CompensationHandlerActivity)
            {
                Header.Text = DR.GetString(DR.WorkflowCompensation);
                HelpText = String.Empty;
            }
            else if (hostedDesigner.Activity is CancellationHandlerActivity)
            {
                Header.Text = DR.GetString(DR.WorkflowCancellation);
                HelpText = String.Empty;
            }
            else
            {
                Header.Text = DR.GetString(DR.StartSequentialWorkflow);
                HelpText = DR.GetString(DR.SequentialWorkflowHelpText);
            }
        }
 protected override void OnViewChanged(DesignerView view)
 {
     base.OnViewChanged(view);
     ActivityDesigner designer = (base.ActiveView != null) ? base.ActiveView.AssociatedDesigner : null;
     if (designer.Activity is FaultHandlersActivity)
     {
         this.Header.Text = System.Workflow.Activities.DR.GetString("WorkflowExceptions");
         this.HelpText = string.Empty;
     }
     else if (designer.Activity is EventHandlersActivity)
     {
         this.Header.Text = System.Workflow.Activities.DR.GetString("WorkflowEvents");
         this.HelpText = string.Empty;
     }
     else if (designer.Activity is CompensationHandlerActivity)
     {
         this.Header.Text = System.Workflow.Activities.DR.GetString("WorkflowCompensation");
         this.HelpText = string.Empty;
     }
     else if (designer.Activity is CancellationHandlerActivity)
     {
         this.Header.Text = System.Workflow.Activities.DR.GetString("WorkflowCancellation");
         this.HelpText = string.Empty;
     }
     else
     {
         this.Header.Text = System.Workflow.Activities.DR.GetString("StartSequentialWorkflow");
         this.HelpText = System.Workflow.Activities.DR.GetString("SequentialWorkflowHelpText");
     }
 }
        public override bool Equals(object obj)
        {
            DesignerView view = obj as DesignerView;

            if (view == null)
            {
                return(false);
            }
            return(this.viewId == view.viewId);
        }
        private void OnSmartTagVerbStatus(object sender, EventArgs e)
        {
            ActivityDesignerVerb verb = sender as ActivityDesignerVerb;
            DesignerView         view = verb.Properties[DesignerUserDataKeys.DesignerView] as DesignerView;

            if (view != null)
            {
                verb.Checked = view == this.ActiveView;
            }
        }
Пример #5
0
        public override void EnsureVisibleContainedDesigner(ActivityDesigner containedDesigner)
        {
            if (containedDesigner == null)
            {
                throw new ArgumentNullException("containedDesigner");
            }

            //we could be collapsed, make sure the view itself is visible
            this.Expanded = true;

            ActivityDesigner activeDesigner = ActiveDesigner;

            if (containedDesigner != activeDesigner && containedDesigner != this)
            {
                DesignerView viewToActivate             = null;
                ReadOnlyCollection <DesignerView> views = ValidatedViews;

                //Go thru the views and check if the child designer is one of the views
                foreach (DesignerView view in views)
                {
                    if (containedDesigner == view.AssociatedDesigner)
                    {
                        viewToActivate = view;
                        break;
                    }
                }

                //This means that the child designer is in our main flow
                if (viewToActivate == null)
                {
                    viewToActivate = views[0];
                }

                ActiveView = viewToActivate;

                //Invoking a verb might change the shown view so we map again
                CompositeActivityDesigner activeCompositeDesigner = ActiveDesigner as CompositeActivityDesigner;
                if (activeCompositeDesigner != null)
                {
                    if (activeCompositeDesigner != this)
                    {
                        activeCompositeDesigner.EnsureVisibleContainedDesigner(containedDesigner);
                    }
                    else
                    {
                        base.EnsureVisibleContainedDesigner(containedDesigner);
                    }
                }
            }
        }
        private void OnSmartTagVerb(object sender, EventArgs e)
        {
            ActivityDesignerVerb verb = sender as ActivityDesignerVerb;
            DesignerView         view = verb.Properties[DesignerUserDataKeys.DesignerView] as DesignerView;

            if (view != null)
            {
                this.ActiveView = view;
                if (this.Expanded && (view.AssociatedDesigner != null))
                {
                    ISelectionService service = base.GetService(typeof(ISelectionService)) as ISelectionService;
                    if (service != null)
                    {
                        service.SetSelectedComponents(new object[] { view.AssociatedDesigner.Activity }, SelectionTypes.Replace);
                    }
                }
            }
        }
        public override void EnsureVisibleContainedDesigner(ActivityDesigner containedDesigner)
        {
            if (containedDesigner == null)
            {
                throw new ArgumentNullException("containedDesigner");
            }
            this.Expanded = true;
            ActivityDesigner activeDesigner = this.ActiveDesigner;

            if ((containedDesigner != activeDesigner) && (containedDesigner != this))
            {
                DesignerView view = null;
                ReadOnlyCollection <DesignerView> validatedViews = this.ValidatedViews;
                foreach (DesignerView view2 in validatedViews)
                {
                    if (containedDesigner == view2.AssociatedDesigner)
                    {
                        view = view2;
                        break;
                    }
                }
                if (view == null)
                {
                    view = validatedViews[0];
                }
                this.ActiveView = view;
                CompositeActivityDesigner designer2 = this.ActiveDesigner as CompositeActivityDesigner;
                if (designer2 != null)
                {
                    if (designer2 != this)
                    {
                        designer2.EnsureVisibleContainedDesigner(containedDesigner);
                    }
                    else
                    {
                        base.EnsureVisibleContainedDesigner(containedDesigner);
                    }
                }
            }
        }
 /// <summary>
 /// Called when the current view of the designer changes
 /// </summary>
 /// <param name="view">View which is being set.</param>
 protected virtual void OnViewChanged(DesignerView view)
 {
     PerformLayout();
 }
Пример #9
0
 /// <summary>
 /// Called when the current view of the designer changes
 /// </summary>
 /// <param name="view">View which is being set.</param>
 protected virtual void OnViewChanged(DesignerView view)
 {
     PerformLayout();
 }