Exemplo n.º 1
0
 public void addPhoto(Photo p)
 {
     if (Photos.Count < pLimit)
     {
         Photos.Add(p);
         if (Description == null)
         {
             Description = p.Description;
         }
     }
 }
Exemplo n.º 2
0
 public Product(Photo p)
 {
     addPhoto(p);
 }
Exemplo n.º 3
0
        private void extrachPhotos(string content)
        {
            String pattern = "\"media\":{\"content\":\\[{\"url\":\"([^\"]+)\".*?\\],\"description\":\"([^\"]*)\"";

            MatchCollection matches = Regex.Matches(content, pattern, RegexOptions.IgnoreCase);

            for (int i = 0; i < matches.Count; i++)
            {
                Photo p = new Photo(matches[i].Groups[1].Value, matches[i].Groups[2].Value);
                photos.Add(p);
            }

        }