示例#1
0
        protected override T CreateInstance(Ninject.Activation.IContext context)
        {
            var resource = Scoping.getContextAttribute <ResourceAttribute>(context);

            if (resource == null)
            {
                throw new ArgumentException("Injected resources must have Resource attributes");
            }

            return(loader.loadResource <T>(resource.Path));
        }
示例#2
0
        public T CreateInstance(Ninject.Activation.IContext context)
        {
            XMLConfigValue value = Scoping.getContextAttribute <XMLConfigValue>(context);

            if (value == null)
            {
                return(default(T));
            }

            return(manager.getValue <T>(value.file, value.xpath));
        }