Пример #1
0
 private void OnDisposeService(Type serviceType, object service)
 {
     if (serviceType == typeof(IReferenceService))
     {
         ReferenceService refService = service as ReferenceService;
         if (refService != null)
         {
             refService.Dispose();
         }
     }
 }
Пример #2
0
            private object OnCreateService(IServiceContainer container, Type serviceType)
            {
                object createdService = null;

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

                return(createdService);
            }
Пример #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);
        }