Exemplo n.º 1
0
 public void AddPhotoItem(PhotoItem photo)
 {
     if (!checkIfPhotoExists(photo))
     {
         photoList.Add(photo);
         OnPropertyChanged();
     }
 }
Exemplo n.º 2
0
        private bool checkIfPhotoExists(PhotoItem photo)
        {
            bool found = false;

            foreach (PhotoItem listItem in photoList)
            {
                string listItemPath = (listItem.FilePath + "//" + listItem.FileName + listItem.FileExt).ToLower();
                string photoPath    = (photo.FilePath + "//" + listItem.FileName + listItem.FileExt).ToLower();

                if (listItemPath.Equals(photoPath) == true)
                {
                    found = true;
                    //throw new Exception("exists");
                    break;
                }
            }

            return(found);
        }