public ActionResult DeleteConfirmed(int id)
        {
            PhotoSource photosource = db.PhotoSources.Find(id);

            db.PhotoSources.Remove(photosource);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ID,Source,URL")] PhotoSource photosource)
 {
     if (ModelState.IsValid)
     {
         db.Entry(photosource).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(photosource));
 }
        public ActionResult Create([Bind(Include = "ID,Source,URL")] PhotoSource photosource)
        {
            if (ModelState.IsValid)
            {
                db.PhotoSources.Add(photosource);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(photosource));
        }
Ejemplo n.º 4
0
 public async Task<ImageSource> GetImageAsync(PhotoSource source,
     ImageOptions options = null)
 {
     switch (source)
     {
         case PhotoSource.Camera:
             return await GetImageFromCameraAsync(options);
         default:
             return await GetImageFromExistingAsync(options);
     }
 }
        // GET: /PhotoSource/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PhotoSource photosource = db.PhotoSources.Find(id);

            if (photosource == null)
            {
                return(HttpNotFound());
            }
            return(View(photosource));
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            IUserInterface userInterface = new UserInterface();


            if (args.Length < 2)
            {
                userInterface.WriteError("Merci de fournir : le dossier de lecture des images, et le dossier de rangement des images");
                return;
            }
            var sourceFolder = args[0];
            var targetFolder = args[1];

            IPhotoSource source = new PhotoSource(sourceFolder);
            IFileMover   mover  = new FileMover(targetFolder);


            var engine = new PhotoSorterEngine(mover, source, userInterface);

            engine.Run();
        }
Ejemplo n.º 7
0
#pragma warning disable 1998
        public async Task<ImageSource> GetImageAsync(PhotoSource source, ImageOptions options = null)
#pragma warning restore 1998
        {
            return null;
        }