Example #1
0
 public void BeginResolve()
 {
     if (isBeginResolved)
     {
         return;
     }
     isBeginResolved = true;
     Task.Factory.StartNew(() =>
     {
         if (Setting.Instance.TweetExperienceProperty.UrlResolveMode == Configuration.Settings.UrlResolve.OnPointed)
         {
             url = ShortenManager.Extract(url);
         }
         ResolvedUrl  = url;
         ImageLinkUrl = UploaderManager.TryResolve(url);
     });
 }
Example #2
0
        private void ResolvePhotos()
        {
            var tokens = Tokenizer.Tokenize(this.TweetText);
            var uris   = tokens
                         .Where(t => t.Kind == TokenKind.Url).ToArray();

            if (uris.Length > 0)
            {
                IsPhotoResolving = true;
                _photoThumbUrls  = uris
                                   .Select(t => UploaderManager.TryResolve(ShortenManager.Extract(t.Text)))
                                   .Where(u => u != null)
                                   .Select(s => new PhotoThumbnailViewModel(new Uri(s)))
                                   .ToArray();
                IsPhotoResolving = false;
                RaisePropertyChanged(() => PhotoThumbnails);
            }
            else
            {
                _photoThumbUrls  = new PhotoThumbnailViewModel[0];
                IsPhotoResolving = false;
            }
        }