예제 #1
0
        /// <summary>
        /// Gets the component dictionary from the container.
        /// </summary>
        /// <returns></returns>
        protected Dictionary <int, KeyValuePair <string, Component> > GetComponentDictionary()
        {
            if (ContainerType.IsNullOrWhiteSpace())
            {
                return(null);
            }

            var resolvedContainerType = Type.GetType(ContainerType);

            if (resolvedContainerType == null)
            {
                return(null);
            }

            var instanceProperty = resolvedContainerType.GetProperty("Instance");

            if (instanceProperty == null)
            {
                return(null);
            }

            var container = instanceProperty.GetValue(null, null) as IContainer;

            return(container?.Dictionary);
        }