Exemplo n.º 1
0
        private void AddGroup(string id, string name)
        {
            var api    = new FiveHundredPxAPIClient("2c6841a7a043af073d5e4f63eefec79029601b03", new JsonDataTranslator());
            var result = api.Get(string.Format("/v1/photos?feature={0}&sort=created_at&image_size=4&include_store=store_download&include_states=voted", id));

            result.Completed = delegate(IAsyncOperation <dynamic> asyncAction, AsyncStatus asyncStatus)
            {
                var data = asyncAction.GetResults();

                var group = new ImageDataGroup(id,
                                               name,
                                               "",
                                               data.photos[0].image_url.ToString(),
                                               data.photos[0].description.ToString());

                foreach (var photo in data.photos)
                {
                    group.Items.Add(new ImageDataItem(photo.id.ToString(),
                                                      photo.name.ToString(),
                                                      photo.user.fullname.ToString(),
                                                      photo.image_url.ToString(),
                                                      photo.description.ToString(),
                                                      photo.description.ToString(),
                                                      group));
                }
                this.AllGroups.Add(group);
            };
        }
Exemplo n.º 2
0
        private void AddGroup(string id, string name)
        {
            var api = new FiveHundredPxAPIClient("0d2f6ebac030037b57c9d8ce63228db2bc5747dd", new JsonDataTranslator());
            //var result = api.Get(string.Format("/v1/photos?feature={0}&sort=created_at&image_size=4&include_store=store_download&include_states=voted", id));
            var result = api.Get(string.Format("/v1/photos/search?term={0}", id));

            result.Completed = delegate(IAsyncOperation<dynamic> asyncAction, AsyncStatus asyncStatus)
            {
                var data = asyncAction.GetResults();

                var group = new ImageDataGroup(id,
                                    name,
                                    "",
                                    data.photos[0].image_url.ToString(),
                                    data.photos[0].description.ToString());

                foreach (var photo in data.photos)
                {
                    group.Items.Add(new ImageDataItem(photo.id.ToString(),
                                            photo.name.ToString(),
                                            photo.user.fullname.ToString(),
                                            photo.image_url.ToString(),
                                            photo.description.ToString(),
                                            photo.description.ToString(),
                                            group));
                }
                this.AllGroups.Add(group);
            };
        }
Exemplo n.º 3
0
 public ImageDataItem(String uniqueId, String title, String subtitle, String imagePath, String description, String content, ImageDataGroup group)
     : base(uniqueId, title, subtitle, imagePath, description)
 {
     this._content = content;
     this._group = group;
 }
Exemplo n.º 4
0
 public ImageDataItem(String uniqueId, String title, String subtitle, String imagePath, String description, String content, ImageDataGroup group)
     : base(uniqueId, title, subtitle, imagePath, description)
 {
     this._content = content;
     this._group   = group;
 }