public ExecutorViewModel(ExecutorClass executor, /*ExecutorRepository executorRepository,*/ BatteryRepository batteryRepository, ChamberRepository chamberRepository, TesterRepository testerRepository)     //ExecutorView需要
        {
            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            //if (executorRepository == null)
            //throw new ArgumentNullException("executorRepository");

            if (batteryRepository == null)
            {
                throw new ArgumentNullException("batteryRepository");
            }

            if (chamberRepository == null)
            {
                throw new ArgumentNullException("chamberRepository");
            }

            if (testerRepository == null)
            {
                throw new ArgumentNullException("testerRepository");
            }

            _executor = executor;
            //_executorRepository = executorRepository;
            _batteryRepository = batteryRepository;
            _chamberRepository = chamberRepository;
            _testerRepository  = testerRepository;
        }
        public AllExecutorsViewModel(RequestRepository requestRepository, BatteryRepository batteryRepository, ChamberRepository chamberRepository, TesterRepository testerRepository)
        {
            if (requestRepository == null)
            {
                throw new ArgumentNullException("requestRepository");
            }

            if (batteryRepository == null)
            {
                throw new ArgumentNullException("batteryRepository");
            }

            if (chamberRepository == null)
            {
                throw new ArgumentNullException("chamberRepository");
            }

            if (testerRepository == null)
            {
                throw new ArgumentNullException("testerRepository");
            }

            base.DisplayName = Resources.AllExecutorsViewModel_DisplayName;

            _requestRepository = requestRepository;

            _batteryRepository = batteryRepository;

            _chamberRepository = chamberRepository;

            _testerRepository = testerRepository;

            // Subscribe for notifications of when a new customer is saved.
            _requestRepository.ItemAdded += this.OnRequestAddedToRepository;

            // Populate the AllCustomers collection with RequestModelViewModels.
            this.CreateAllExecutors();
            this.BookExecutorAddedEvent();
        }
Пример #3
0
 // CONSTRUCTION
 static TesterFactory()
 {
     _repository = new TesterRepository();
 }