Ejemplo n.º 1
0
 public DepositService(
     ApplicationDbContext dbContext,
     IPhotoFileService photoFileService)
 {
     _dbContext        = dbContext;
     _photoFileService = photoFileService;
 }
Ejemplo n.º 2
0
 public DepositService(
     ApplicationDbContext dbContext,
     IPhotoFileService photoFileService)
 {
     _dbContext = dbContext;
     _photoFileService = photoFileService;
 }
        public static void SetUpTestCase(TestContext context)
        {
            // リポジトリ生成
            var repos = new RepositoryFactory(PhotoFrame.Persistence.Type.EF);

            photoRepository   = repos.PhotoRepository;
            keywordRepository = repos.KeywordRepository;
            ServiceFactory serviceFactory = new ServiceFactory();

            photoFileService = serviceFactory.PhotoFileService;
        }
Ejemplo n.º 4
0
        public PhotoFrameApplication()
        {
            this.ServiceFactory = new ServiceFactory();

            this.repositoryMaster = new RepositoryMaster();
            this.photoFileService = ServiceFactory.PhotoFileService;

            this.searchFolder       = new SearchFolder(repositoryMaster, photoFileService);
            this.filter             = new Filter(repositoryMaster);
            this.addKeyword         = new AddKeyword(repositoryMaster);
            this.deleteKeyword      = new DeleteKeyword(repositoryMaster);
            this.toggleIsFavorite   = new ToggleIsFavorite(repositoryMaster);
            this.addAlbum           = new AddAlbum(repositoryMaster);
            this.searchAlbum        = new SearchAlbum(repositoryMaster);
            this.sortDateAscending  = new SortDateAscending();
            this.sortDateDescending = new SortDateDescending();
            this.getAllAlbums       = new GetAllAlbums(repositoryMaster);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public PhotoFrameForm()
        {
            InitializeComponent();

            // リポジトリ生成・初期化
            RepositoryFactory repositoryFactory = new RepositoryFactory(PhotoFrame.Persistence.Type.Csv);
            //RepositoryFactory repositoryFactory = new RepositoryFactory(PhotoFrame.Persistence.Type.EF);
            ServiceFactory serviceFactory = new ServiceFactory();

            photoRepository   = repositoryFactory.PhotoRepository;
            keywordRepository = repositoryFactory.KeywordRepository;
            photoFileService  = serviceFactory.PhotoFileService;
            searchedPhotos    = new List <Photo>().AsEnumerable();
            controller        = new Controller(keywordRepository, photoRepository, photoFileService);

            // キーワード解除用文字列の登録
            comboBoxChangeKeyword.Items.Add("設定解除");

            // 全アルバム名を取得し、アルバム変更リストをセット
            UpdateKeywordList();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public Form1()
        {
            InitializeComponent();

            // 各テストごとにデータベースファイルを削除
            // (35-42をコメントアウトしても動きます)
            if (System.IO.File.Exists("_Photo.csv"))
            {
                System.IO.File.Delete("_Photo.csv");
            }
            if (System.IO.File.Exists("_Album.csv"))
            {
                System.IO.File.Delete("_Album.csv");
            }

            // メンバ変数初期化
            RepositoryFactory repositoryFactory = new RepositoryFactory(PhotoFrame.Persistence.Type.Csv);
            ServiceFactory    serviceFactory    = new ServiceFactory();

            photoRepository  = repositoryFactory.PhotoRepository;
            albumRepository  = repositoryFactory.AlbumRepository;
            photoFileService = serviceFactory.PhotoFileService;
            application      = new PhotoFrameApplication(albumRepository, photoRepository, photoFileService);
            searchedPhotos   = new List <Photo>().AsEnumerable();

            flagAsync = false;

            // 全アルバム名を取得し、アルバム変更リストをセット
            IEnumerable <Album> allAlbums = albumRepository.Find((IQueryable <Album> albums) => albums);

            if (allAlbums != null)
            {
                foreach (Album album in allAlbums)
                {
                    comboBox_ChangeAlbum.Items.Add(album.Name);
                }
            }
        }
Ejemplo n.º 7
0
 public PhotoFrameApplication(IAlbumRepository albumRepository, IPhotoRepository photoRepository, IPhotoFileService photoFileService)
 {
     this.createAlbum     = new CreateAlbum(albumRepository);
     this.searchAlbum     = new SearchAlbum(photoRepository);
     this.searchDirectory = new SearchDirectory(photoRepository, photoFileService);
     this.toggleFavorite  = new ToggleFavorite(photoRepository);
     this.changeAlbum     = new ChangeAlbum(albumRepository, photoRepository);
 }
 public SearchFolder(IPhotoRepository photoRepository, IPhotoFileService photoFileService)
 {
     _photoRepository  = photoRepository;
     _photoFileService = photoFileService;
 }
Ejemplo n.º 9
0
 public void SetUp()
 {
     service = new ServiceFactory().PhotoFileService;
 }
Ejemplo n.º 10
0
 public SearchDirectory(IPhotoRepository photoRepository, IPhotoFileService photoFileService)
 {
     this.photoRepository  = photoRepository;
     this.photoFileService = photoFileService;
 }
Ejemplo n.º 11
0
 public CreatePhotoList(PhotoRepository photoRepository, IPhotoFileService photoFileService)
 {
     this.photoRepository  = photoRepository;
     this.photoFileService = photoFileService;
 }
Ejemplo n.º 12
0
 public ServiceFactory()
 {
     PhotoFileService = new PhotoFileService();
 }
Ejemplo n.º 13
0
 public MainFrame()
 {
     InitializeComponent();
     // 後で消す
     service = new ServiceFactory().PhotoFileService;
 }
Ejemplo n.º 14
0
 public FindDirectory(IAlbumRepository albumRepository, IPhotoRepository photoRepository)
 {
     this.albumRepository = albumRepository;
     this.photoRepository = photoRepository;
     service = new ServiceFactory().PhotoFileService;
 }
 public PhotoFrameApplication(IKeywordRepository keywordRepository, IPhotoRepository photoRepository, IPhotoFileService photoFileService)
 {
     _registKeyword  = new RegistKeyword(keywordRepository);
     _detailSearch   = new DetailSearch();
     _searchFolder   = new SearchFolder(photoRepository, photoFileService);
     _toggleFavorite = new ToggleFavorite(photoRepository);
     _sortList       = new SortList();
     _changeKeyword  = new ChangeKeyword(keywordRepository, photoRepository);
     _getKeywordList = new GetKeywordList(keywordRepository);
 }
Ejemplo n.º 16
0
 public SearchFolder(RepositoryMaster repositoryMaster, IPhotoFileService photoFileService)
 {
     this.repositoryMaster = repositoryMaster;
     this.photoFileService = photoFileService;
 }
Ejemplo n.º 17
0
 public Controller(IKeywordRepository keywordRepository, IPhotoRepository photoRepository, IPhotoFileService photoFileService)
 {
     this.application = new PhotoFrameApplication(keywordRepository, photoRepository, photoFileService);
 }