Exemplo n.º 1
0
        public void AddMediaItem(String conversationID, String fileID, String fileName, int position, bool reachedRight = false)
        {
            Console.WriteLine("reached right: " + reachedRight);
            foreach (var uiElement in Gallery.Children)
            {
                if (!(uiElement is ThumbnailButton))
                {
                    continue;
                }
                ThumbnailButton btn = uiElement as ThumbnailButton;
                if (btn.FileID.Equals(fileID, StringComparison.OrdinalIgnoreCase))
                {
                    return;
                }
            }

            String thumbUrl  = StreamAPI.GetMediaThumbnailURL(fileID, conversationID);
            String streamUrl = StreamAPI.GetMediaURL(fileID, conversationID);

            MediaInfo media = new MediaInfo(thumbUrl, streamUrl, fileName, fileID);

            LoadThumbnail(media, int.MaxValue);

            IsReachedRight = reachedRight;
            borderRight    = Math.Min(position, borderRight);
        }
Exemplo n.º 2
0
        public MediaInfo GetMediaInfo(string fileID, string fileName, string conversationID)
        {
            String thumbUrl  = StreamAPI.GetMediaThumbnailURL(fileID, conversationID);
            String streamUrl = StreamAPI.GetMediaURL(fileID, conversationID);

            MediaInfo media = new MediaInfo(thumbUrl, streamUrl, fileName, fileID);

            return(media);
        }
Exemplo n.º 3
0
        public void Demo()
        {
            ThumbnailButton btn = new ThumbnailButton()
            {
                ThumbnailUrl = StreamAPI.GetMediaThumbnailURL("7ca94feb-4f57-4beb-8b6a-fe9225337794", "7516cdee-0971-472c-9a01-b2804dcedd9f"),
                StreamURL    = StreamAPI.GetMediaURL("7ca94feb-4f57-4beb-8b6a-fe9225337794", "7516cdee-0971-472c-9a01-b2804dcedd9f"),
                FileName     = "dreamstime_xxl_65780868_small.jpg",
                FileID       = "7ca94feb-4f57-4beb-8b6a-fe9225337794"
            };

            btn.Click += BtnClick;
            Gallery.Children.Add(btn);
        }
Exemplo n.º 4
0
        public void AddMediaItemToFirst(String conversationID, String fileID, String fileName, int position, bool reachedLeft = true)
        {
            foreach (var uiElement in Gallery.Children)
            {
                if (!(uiElement is ThumbnailButton))
                {
                    continue;
                }
                ThumbnailButton btn = uiElement as ThumbnailButton;
                if (btn.FileID.Equals(fileID, StringComparison.OrdinalIgnoreCase))
                {
                    return;
                }
            }

            String thumbUrl  = StreamAPI.GetMediaThumbnailURL(fileID, conversationID);
            String streamUrl = StreamAPI.GetMediaURL(fileID, conversationID);

            MediaInfo media = new MediaInfo(thumbUrl, streamUrl, fileName, fileID);

            LoadThumbnail(media, 0);
        }