예제 #1
0
        private object CreateInstance(RegistrationModel model, object[] arguments = null)
        {
            object returnedObj  = null;
            Type   typeToCreate = model.ObjectType;

            if (model.RegType == REG_TYPE.TRANSIENT)
            {
                returnedObj = AddTransientInstance.GetInstance().GetNewObject(typeToCreate, arguments);
            }
            else if (model.RegType == REG_TYPE.SINGLETON)
            {
                returnedObj = AddSingletonInstance.GetInstance().GetSingleton(typeToCreate, arguments);
            }

            return(returnedObj);
        }
예제 #2
0
 static AddSingletonInstance()
 {
     instance = new AddSingletonInstance();
 }