Ejemplo n.º 1
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;
                }
            }
        }
Ejemplo n.º 2
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;
         }
     }
 }
Ejemplo n.º 3
0
        public override void Dispose()
        {
            if (this.eventsCoordinator != null)
            {
                ((IDisposable)this.eventsCoordinator).Dispose();
                this.eventsCoordinator = null;
            }

            if (this.customActivityDesignerAdapter != null)
            {
                ((IDisposable)this.customActivityDesignerAdapter).Dispose();
                this.customActivityDesignerAdapter = null;
            }

            IExtenderProviderService extenderProviderService = GetService(typeof(IExtenderProviderService)) as IExtenderProviderService;

            if (extenderProviderService != null)
            {
                foreach (IExtenderProvider extender in ComponentDispenser.Extenders)
                {
                    extenderProviderService.RemoveExtenderProvider(extender);
                }
            }

            if (LoaderHost != null)
            {
                if (this.createdServices != null)
                {
                    foreach (Type serviceType in this.createdServices.Keys)
                    {
                        LoaderHost.RemoveService(serviceType);
                        OnDisposeService(serviceType, this.createdServices[serviceType]);
                    }
                    this.createdServices.Clear();
                    this.createdServices = null;
                }
                LoaderHost.RemoveService(typeof(WorkflowDesignerLoader));
            }

            base.Dispose();
        }
        public override void Dispose()
        {
            if (this.eventsCoordinator != null)
            {
                ((IDisposable)this.eventsCoordinator).Dispose();
                this.eventsCoordinator = null;
            }

            if (this.customActivityDesignerAdapter != null)
            {
                ((IDisposable)this.customActivityDesignerAdapter).Dispose();
                this.customActivityDesignerAdapter = null;
            }

            IExtenderProviderService extenderProviderService = GetService(typeof(IExtenderProviderService)) as IExtenderProviderService;
            if (extenderProviderService != null)
            {
                foreach (IExtenderProvider extender in ComponentDispenser.Extenders)
                    extenderProviderService.RemoveExtenderProvider(extender);
            }

            if (LoaderHost != null)
            {
                if (this.createdServices != null)
                {
                    foreach (Type serviceType in this.createdServices.Keys)
                    {
                        LoaderHost.RemoveService(serviceType);
                        OnDisposeService(serviceType, this.createdServices[serviceType]);
                    }
                    this.createdServices.Clear();
                    this.createdServices = null;
                }
                LoaderHost.RemoveService(typeof(WorkflowDesignerLoader));
            }

            base.Dispose();
        }
        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;
                }
            }
        }
 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;
         }
     }
 }