Example #1
0
        private TToResolve CreateInstance <TToResolve>(Type typeToBuild) where TToResolve : class
        {
            if (typeToBuild.IsInterface)
            {
                typeToBuild = _toResolve[typeToBuild];
            }

            object instance = MvxOpenNetCfObjectBuilder.CreateObject(typeToBuild);

            return((TToResolve)instance);
        }
Example #2
0
        private TToResolve CreateInstance <TToResolve>(Type typeToBuild) where TToResolve : class
        {
#if NETFX_CORE
            if (typeToBuild.GetTypeInfo().IsInterface)
            {
                typeToBuild = _toResolve[typeToBuild];
            }
#else
            if (typeToBuild.IsInterface)
            {
                typeToBuild = _toResolve[typeToBuild];
            }
#endif

            var instance = MvxOpenNetCfObjectBuilder.CreateObject(typeToBuild);
            return((TToResolve)instance);
        }
Example #3
0
        /// <summary>
        ///   Create a new instance at each time
        /// </summary>
        /// <returns></returns>
        public object GetInstance(Type typeToBuild)
        {
            var instance = MvxOpenNetCfObjectBuilder.CreateObject(typeToBuild);

            return(instance);
        }