示例#1
0
        static void Main(string[] args)
        {
            ICreditManager requirementCreditManager = new RequirementCreditManager();
            ICreditManager vehicleCreditManager     = new VehicleCreditManager();
            ICreditManager housingCreditManager     = new HousingCreditManager();

            //IloggerService databaseLoggerService = new DataBaseLoggerService();
            //IloggerService fileLoggerService = new FileLoggerService();
            List <IloggerService> loggers = new List <IloggerService>()
            {
                new  FileLoggerService(), new  DataBaseLoggerService()
            };

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.Apply(vehicleCreditManager, new List <IloggerService>()
            {
                new DataBaseLoggerService(), new FileLoggerService()
            });
            applicationManager.Apply(housingCreditManager, loggers);

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                requirementCreditManager, housingCreditManager
            };
            //applicationManager.MakeEnlightenment(credits);
        }
示例#2
0
文件: Program.cs 项目: mltm-n/CS.Camp
        static void Main(string[] args)
        {
            /*(ICreditManager)*/
            RequirementCreditManager requirementCreditManager = new RequirementCreditManager();
            ICreditManager           dwellingCreditManager    = new DwellingCreditManager();
            ICreditManager           vehicleCreditManager     = new VehicleCreditManager();

            /* if you write;
             * ILoggerService databaseLoggerService = new DatabaseLoggerService();
             * ILoggerService fileLoggerService = new FileLoggerService();
             * instead of ....,new DatabaseLoggerService -> (databaseLoggerService)*/

            RequestManager requestManager = new RequestManager();

            //new List<ILoggerService> { new DatabaseLoggerService(), new FileLoggerService()}
            requestManager.Request(vehicleCreditManager, new DatabaseLoggerService());

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                vehicleCreditManager, dwellingCreditManager
            };

            //requestManager.CreditPreinforming(credits);
        }