public QuoteManager(IQuoteLoader loader)
 {
     if (Instance != null)
     {
         throw new Exception("Can only create a single QuoteManager.");
     }
     Instance  = this;
     this.repo = loader;
     Quotes    = new ObservableCollection <GreatQuote>(loader.Load());
 }
Ejemplo n.º 2
0
//        QuoteManager()
//        {
//            _repo = QuoteRepositoryFactory.Create();
//            Quotes = _repo.Load().ToList();
//        }

        public QuoteManager(IQuoteRepository repo)
        {
            if (Instance != null)
            {
                throw new Exception("Can only create a single QuoteManager.");
            }
            Instance = this;

            this._repo = repo;
            Quotes     = _repo.Load().ToList();
        }