예제 #1
0
        /// <summary>
        /// <para>Gets the registered <see cref="ILinkNodeService"/>.</para>
        /// </summary>
        /// <param name="serviceProvider">
        /// <para>The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</para>
        /// </param>
        /// <returns>
        /// <para>The registered <see cref="ILinkNodeService"/>.</para>
        /// </returns>
        public static ILinkNodeService GetLinkService(IServiceProvider serviceProvider)
        {
            ILinkNodeService linkNodeService = serviceProvider.GetService(typeof(ILinkNodeService)) as ILinkNodeService;

            Debug.Assert(linkNodeService != null, "Could not get the ILinkNodeService");
            return(linkNodeService);
        }
예제 #2
0
 public virtual void SetUp()
 {
     host                         = new ConfigurationDesignHost();
     hierarchyService             = (IUIHierarchyService)host.GetService(typeof(IUIHierarchyService));
     configurationErrorLogService = (IConfigurationErrorLogService)host.GetService(typeof(IConfigurationErrorLogService));
     xmlIncludeTypeService        = (IXmlIncludeTypeService)host.GetService(typeof(IXmlIncludeTypeService));
     nodeCreationService          = (INodeCreationService)host.GetService(typeof(INodeCreationService));
     container                    = (IContainer)host.GetService(typeof(IContainer));
     linkNodeService              = (ILinkNodeService)host.GetService(typeof(ILinkNodeService));
     host.AddService(typeof(IUIService), new MyUIService(this));
     validationErrorsCount    = 0;
     configurationErrorsCount = 0;
     applicationNode          = new ApplicationConfigurationNode(ApplicationData.FromCurrentAppDomain());
     uiHierarchy = CreateHierarchyAndAddToHierarchyService(applicationNode, CreateDefaultConfiguration());
 }
예제 #3
0
        public void AssertCanGetAllServices()
        {
            IContainer container = Host.GetService(typeof(IContainer)) as IContainer;

            Assert.IsNotNull(container);
            IComponentChangeService changeService = Host.GetService(typeof(IComponentChangeService)) as IComponentChangeService;

            Assert.IsNotNull(changeService);
            INodeNameCreationService nodeNameCreationService = Host.GetService(typeof(INodeNameCreationService)) as INodeNameCreationService;

            Assert.IsNotNull(nodeNameCreationService);
            INameCreationService nameCreationService = Host.GetService(typeof(INameCreationService)) as INameCreationService;

            Assert.IsNotNull(nameCreationService);
            IUIHierarchyService hierarchyService = Host.GetService(typeof(IUIHierarchyService)) as IUIHierarchyService;

            Assert.IsNotNull(hierarchyService);
            IDictionaryService dictionaryService = Host.GetService(typeof(IDictionaryService)) as IDictionaryService;

            Assert.IsNotNull(dictionaryService);
            IConfigurationErrorLogService configurationErrorLogService = Host.GetService(typeof(IConfigurationErrorLogService)) as IConfigurationErrorLogService;

            Assert.IsNotNull(configurationErrorLogService);
            INodeCreationService nodeCreationService = Host.GetService(typeof(INodeCreationService)) as INodeCreationService;

            Assert.IsNotNull(nodeCreationService);
            IXmlIncludeTypeService xmlIncludeTypeService = Host.GetService(typeof(IXmlIncludeTypeService)) as IXmlIncludeTypeService;

            Assert.IsNotNull(xmlIncludeTypeService);
            ILinkNodeService linkNodeService = Host.GetService(typeof(ILinkNodeService)) as ILinkNodeService;

            Assert.IsNotNull(linkNodeService);
            IMenuContainerService menuContainerService = Host.GetService(typeof(IMenuContainerService)) as IMenuContainerService;

            Assert.IsNotNull(menuContainerService);
        }
 public virtual void SetUp()
 {
     host = new ConfigurationDesignHost();
     hierarchyService = (IUIHierarchyService)host.GetService(typeof(IUIHierarchyService));
     configurationErrorLogService = (IConfigurationErrorLogService)host.GetService(typeof(IConfigurationErrorLogService));
     xmlIncludeTypeService = (IXmlIncludeTypeService)host.GetService(typeof(IXmlIncludeTypeService));
     nodeCreationService = (INodeCreationService)host.GetService(typeof(INodeCreationService));
     container = (IContainer)host.GetService(typeof(IContainer));
     linkNodeService = (ILinkNodeService)host.GetService(typeof(ILinkNodeService));
     host.AddService(typeof(IUIService), new MyUIService(this));
     validationErrorsCount = 0;
     configurationErrorsCount = 0;
     applicationNode = new ApplicationConfigurationNode(ApplicationData.FromCurrentAppDomain());
     uiHierarchy = CreateHierarchyAndAddToHierarchyService(applicationNode, CreateDefaultConfiguration());
 }