コード例 #1
0
        //Create Instance Accoding type
        private object CreateInstance(RegistrationModel model, object[] arg = null, object[] attributes = null)
        {
            object obj  = null;
            var    type = model.ObjectType;

            if (model.RegType == RegType.Singleton)
            {
                obj = SingletonCreationService.GetInstance().GetSingleton(type, arg);
            }
            if (model.RegType == RegType.Instance)
            {
                obj = InstanceCreationService.GetNewObject(type, arg, attributes);
            }
            return(obj);
        }
コード例 #2
0
        private object CreateInstance(RegistrationModel model, object[] arguments = null)
        {
            object returnedObj  = null;
            Type   typeToCreate = model.ObjectType;

            if (model.RegType == REG_TYPE.INSTANCE)
            {
                returnedObj = InstanceCreationService.GetInstance().GetNewObject(typeToCreate, arguments);
            }
            else if (model.RegType == REG_TYPE.SINGLETON)
            {
                returnedObj = SingletonCreationService.GetInstance().GetSingleton(typeToCreate, arguments);
            }

            return(returnedObj);
        }
コード例 #3
0
ファイル: ActionProvider.cs プロジェクト: akobr/strong-beaver
 public ActionProvider(InstanceCreationService objectCreation)
 {
     this.objectCreation = objectCreation;
     registrations       = new Dictionary <Type, Type>();
 }