Exemplo n.º 1
0
        private object OnCreateService(IServiceContainer container, Type serviceType)
        {
            object createdService = null;

            if (serviceType == typeof(ComponentSerializationService))
            {
                createdService = new XomlComponentSerializationService(LoaderHost);
            }
            else if (serviceType == typeof(IReferenceService))
            {
                createdService = new ReferenceService(LoaderHost);
            }
            else if (serviceType == typeof(IIdentifierCreationService))
            {
                createdService = new IdentifierCreationService(container, this);
            }
            else if (serviceType == typeof(IWorkflowCompilerOptionsService))
            {
                createdService = new WorkflowCompilerOptionsService();
            }
            else if (serviceType == typeof(IDesignerVerbProviderService))
            {
                createdService = new DesignerVerbProviderService();
            }

            if (createdService != null)
            {
                if (this.createdServices == null)
                {
                    this.createdServices = new Hashtable();
                }
                object existingService = this.createdServices[serviceType];
                this.createdServices[serviceType] = createdService;
                if (existingService != null)
                {
                    OnDisposeService(serviceType, existingService);
                }
            }

            return(createdService);
        }
Exemplo n.º 2
0
        private object OnCreateService(IServiceContainer container, Type serviceType)
        {
            object obj2 = null;

            if (serviceType == typeof(ComponentSerializationService))
            {
                obj2 = new XomlComponentSerializationService(base.LoaderHost);
            }
            else if (serviceType == typeof(IReferenceService))
            {
                obj2 = new System.Workflow.ComponentModel.Design.ReferenceService(base.LoaderHost);
            }
            else if (serviceType == typeof(IIdentifierCreationService))
            {
                obj2 = new IdentifierCreationService(container, this);
            }
            else if (serviceType == typeof(IWorkflowCompilerOptionsService))
            {
                obj2 = new WorkflowCompilerOptionsService();
            }
            else if (serviceType == typeof(IDesignerVerbProviderService))
            {
                obj2 = new DesignerVerbProviderService();
            }
            if (obj2 != null)
            {
                if (this.createdServices == null)
                {
                    this.createdServices = new Hashtable();
                }
                object service = this.createdServices[serviceType];
                this.createdServices[serviceType] = obj2;
                if (service != null)
                {
                    this.OnDisposeService(serviceType, service);
                }
            }
            return(obj2);
        }
        private object OnCreateService(IServiceContainer container, Type serviceType)
        {
            object createdService = null;

            if (serviceType == typeof(ComponentSerializationService))
                createdService = new XomlComponentSerializationService(LoaderHost);
            else if (serviceType == typeof(IReferenceService))
                createdService = new ReferenceService(LoaderHost);
            else if (serviceType == typeof(IIdentifierCreationService))
                createdService = new IdentifierCreationService(container, this);
            else if (serviceType == typeof(IWorkflowCompilerOptionsService))
                createdService = new WorkflowCompilerOptionsService();
            else if (serviceType == typeof(IDesignerVerbProviderService))
                createdService = new DesignerVerbProviderService();

            if (createdService != null)
            {
                if (this.createdServices == null)
                    this.createdServices = new Hashtable();
                object existingService = this.createdServices[serviceType];
                this.createdServices[serviceType] = createdService;
                if (existingService != null)
                {
                    OnDisposeService(serviceType, existingService);
                }
            }

            return createdService;
        }
 private object OnCreateService(IServiceContainer container, Type serviceType)
 {
     object obj2 = null;
     if (serviceType == typeof(ComponentSerializationService))
     {
         obj2 = new XomlComponentSerializationService(base.LoaderHost);
     }
     else if (serviceType == typeof(IReferenceService))
     {
         obj2 = new System.Workflow.ComponentModel.Design.ReferenceService(base.LoaderHost);
     }
     else if (serviceType == typeof(IIdentifierCreationService))
     {
         obj2 = new IdentifierCreationService(container, this);
     }
     else if (serviceType == typeof(IWorkflowCompilerOptionsService))
     {
         obj2 = new WorkflowCompilerOptionsService();
     }
     else if (serviceType == typeof(IDesignerVerbProviderService))
     {
         obj2 = new DesignerVerbProviderService();
     }
     if (obj2 != null)
     {
         if (this.createdServices == null)
         {
             this.createdServices = new Hashtable();
         }
         object service = this.createdServices[serviceType];
         this.createdServices[serviceType] = obj2;
         if (service != null)
         {
             this.OnDisposeService(serviceType, service);
         }
     }
     return obj2;
 }