예제 #1
0
 internal static ActivityDesigner GetSafeRootDesigner(IServiceProvider serviceProvider)
 {
     if (serviceProvider == null)
     {
         return(null);
     }
     return(ActivityDesigner.GetRootDesigner(serviceProvider));
 }
예제 #2
0
        protected override void OnEndLoad(bool successful, System.Collections.ICollection errors)
        {
            base.OnEndLoad(successful, errors);

            IList            layoutErrors = null;
            ActivityDesigner rootDesigner = ActivityDesigner.GetRootDesigner(LoaderHost);

            if (rootDesigner != null && ((IWorkflowRootDesigner)rootDesigner).SupportsLayoutPersistence)
            {
                LoadDesignerLayoutFromResource(rootDesigner.Activity.GetType(), rootDesigner.Activity.GetType() + ".layout", out layoutErrors);
            }
        }
예제 #3
0
        protected override void OnEndLoad(bool successful, ICollection errors)
        {
            base.OnEndLoad(successful, errors);

            if (successful)
            {
                //We initialize the events coordinator only once when loading of the designer is complete
                ActivityDesigner rootDesigner = ActivityDesigner.GetRootDesigner(LoaderHost);
                if (this.eventsCoordinator == null && (rootDesigner == null || rootDesigner.ParentDesigner == null))
                {
                    this.eventsCoordinator = new WorkflowDesignerEventsCoordinator(LoaderHost);
                }

                try
                {
                    this.loadingDesignerLayout = true;

                    string layoutFileName = DesignerLayoutFileName;
                    IList  layoutErrors   = null;
                    if (File.Exists(layoutFileName))
                    {
                        LoadDesignerLayout(out layoutErrors);
                    }
                    else if (InDebugMode || (ActivityDesigner.GetRootDesigner(LoaderHost) != null && ActivityDesigner.GetRootDesigner(LoaderHost).ParentDesigner != null))
                    {
                        LoadDesignerLayoutFromResource(out layoutErrors);
                    }

                    if (layoutErrors != null)
                    {
                        if (errors == null)
                        {
                            errors = new ArrayList();
                        }
                        IList designerErrors = errors as IList;
                        if (designerErrors != null)
                        {
                            foreach (object layoutError in layoutErrors)
                            {
                                designerErrors.Add(layoutError);
                            }
                        }
                    }
                }
                finally
                {
                    this.loadingDesignerLayout = false;
                }
            }
        }
예제 #4
0
 protected override void OnEndLoad(bool successful, ICollection errors)
 {
     base.OnEndLoad(successful, errors);
     if (successful)
     {
         ActivityDesigner rootDesigner = ActivityDesigner.GetRootDesigner(base.LoaderHost);
         if ((this.eventsCoordinator == null) && ((rootDesigner == null) || (rootDesigner.ParentDesigner == null)))
         {
             this.eventsCoordinator = new WorkflowDesignerEventsCoordinator(base.LoaderHost);
         }
         try
         {
             this.loadingDesignerLayout = true;
             string designerLayoutFileName = this.DesignerLayoutFileName;
             IList  layoutErrors           = null;
             if (File.Exists(designerLayoutFileName))
             {
                 this.LoadDesignerLayout(out layoutErrors);
             }
             else if (this.InDebugMode || ((ActivityDesigner.GetRootDesigner(base.LoaderHost) != null) && (ActivityDesigner.GetRootDesigner(base.LoaderHost).ParentDesigner != null)))
             {
                 this.LoadDesignerLayoutFromResource(out layoutErrors);
             }
             if (layoutErrors != null)
             {
                 if (errors == null)
                 {
                     errors = new ArrayList();
                 }
                 IList list2 = errors as IList;
                 if (list2 != null)
                 {
                     foreach (object obj2 in layoutErrors)
                     {
                         list2.Add(obj2);
                     }
                 }
             }
         }
         finally
         {
             this.loadingDesignerLayout = false;
         }
     }
 }
 internal static ActivityDesigner GetSafeRootDesigner(IServiceProvider serviceProvider)
 {
     return((serviceProvider != null) ? ActivityDesigner.GetRootDesigner(serviceProvider) : null);
 }