public virtual object GetService(Type service) { object serviceInstance = null; if (typeof(IDictionaryService) == service) { serviceInstance = (IDictionaryService)this; } if (typeof(INestedContainer) == service) { if (_nestedContainer == null) { _nestedContainer = new DesignModeNestedContainer(_component, null); } serviceInstance = _nestedContainer; } // Avoid returning the site specific IServiceContainer if (serviceInstance == null && service != typeof(IServiceContainer) && _siteSpecificServices != null) { serviceInstance = _siteSpecificServices.GetService(service); } if (serviceInstance == null) { serviceInstance = _serviceProvider.GetService(service); } return(serviceInstance); }
public void DisposeOwner_Invoke_Success() { var owner = new Component(); var container = new NestedContainer(owner); owner.Dispose(); owner.Dispose(); }
public void Ctor_IComponent() { var owner = new Component(); var container = new NestedContainer(owner); Assert.Same(owner, container.Owner); Assert.Empty(container.Components); }
public static IContainer CheckForNestedContainer(IContainer container) { NestedContainer container2 = container as NestedContainer; if (container2 != null) { return(container2.Owner.Site.Container); } return(container); }
public virtual object GetService (Type service) { object serviceInstance = null; if (typeof (IDictionaryService) == service) serviceInstance = (IDictionaryService) this; if (typeof (INestedContainer) == service) { if (_nestedContainer == null) _nestedContainer = new DesignModeNestedContainer (_component, null); serviceInstance = _nestedContainer; } if (serviceInstance == null && _siteSpecificServices != null) serviceInstance = _siteSpecificServices.GetService (service); if (serviceInstance == null) serviceInstance = _serviceProvider.GetService (service); return serviceInstance; }
public Site (IComponent component, NestedContainer container, string name) { _component = component; _nestedContainer = container; _siteName = name; }
public void CleanUpNestedContainer() { WebSite?.Close(); NestedContainer?.Dispose(); }
public void CleanupNestedContainer() { NestedContainer?.Dispose(); NestedContainer = null; }
internal Site(IComponent component, NestedContainer container, string?name) { Component = component; Container = container; _name = name; }