Ejemplo n.º 1
0
 private void OnDisposeService(Type serviceType, object service)
 {
     if (serviceType == typeof(IReferenceService))
     {
         ReferenceService refService = service as ReferenceService;
         if (refService != null)
         {
             refService.Dispose();
         }
     }
 }
Ejemplo n.º 2
0
            private object OnCreateService(IServiceContainer container, Type serviceType)
            {
                object createdService = null;

                if (serviceType == typeof(IReferenceService))
                {
                    createdService = new ReferenceService(LoaderHost);
                }

                return(createdService);
            }
Ejemplo n.º 3
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);
        }