/// <summary> /// copy method /// </summary> /// <param name="pm"></param> public void copy(PhotoWeb pm) { PhotoName = pm.PhotoName; PhotoDate = pm.PhotoDate; Photo = pm.Photo; ThumbPhoto = pm.ThumbPhoto; }
/// <summary> /// get the list of the photos /// </summary> private void getListPhotos() { List <PhotoWeb> list = new List <PhotoWeb>(); if (DirectoryOutput != null) { string path = cutPath(DirectoryOutput, "C:", 2); string outputDir = @"../../" + path; string[] files = Directory.GetFiles(outputDir, "*", SearchOption.AllDirectories); Photos.Clear(); foreach (string photo in files) { string fileEnding = Path.GetExtension(photo); if (fileEnding.Equals(".png", StringComparison.CurrentCultureIgnoreCase) || fileEnding.Equals(".gif", StringComparison.CurrentCultureIgnoreCase) || fileEnding.Equals(".jpg", StringComparison.CurrentCultureIgnoreCase) || fileEnding.Equals(".bmp", StringComparison.CurrentCultureIgnoreCase)) { numOfPic++; PhotoWeb temp = new PhotoWeb() { PhotoToShow = @"~/" + cutPath(getNamePath(photo), "ImageServiceWeb", 15), Photo = getNamePath(photo), PhotoName = newGetName(photo), PhotoDate = getDataFromPic(photo), ThumbPhoto = @"~/" + cutPath(photo, "ImageServiceWeb", 15), FullPath = photo }; if (Photos != null && temp.ThumbPhoto.Contains("Thumbnail")) { Photos.Insert(0, temp); } } } } }