Beispiel #1
0
 internal void RemoveSmartImage(SmartImage image)
 {
     if (image != null && smartImageList.Contains(image))
     {
         smartImageList.Remove(image);
     }
 }
Beispiel #2
0
        private static SmartImage BuildImgControl(HtmlElement item)
        {
            //TODO: crash @ http://imgsrc.baidu.com/forum/w%3D580%3Bcp%3Dtieba%2C10%2C666%3Bap%3Dsnh48%B0%C9%2C90%2C674/sign=d10ca71e0b24ab18e016e13f05c185bd/42a0283fb80e7becd78d41d92d2eb9389a506bd0.jpg
            var url = Uri.UnescapeDataString(item.Attributes["src"]);

            if (url == null)
            {
                return(null);
            }

            S1Resource.GetAbsoluteUrl(ref url);
            bool isEmotion = S1Resource.IsEmotion(url);

            var image = new SmartImage();

            ImageResourceManager.SetUriSource(image, url);
            if (isEmotion)
            {
                image.Margin = new Thickness(0, 0, 0, -6);
            }
            else
            {
                image.Margin = new Thickness(6);
            }
            return(image);
        }
 public static void SetUriSource(SmartImage obj, string value)
 {
     if (null == obj)
     {
         throw new ArgumentNullException("obj");
     }
     obj.SetValue(UriSourceProperty, value);
 }
 public static string GetUriSource(SmartImage obj)
 {
     if (null == obj)
     {
         throw new ArgumentNullException("obj");
     }
     return (string)obj.GetValue(UriSourceProperty);
 }
Beispiel #5
0
 public static void SetUriSource(SmartImage obj, string value)
 {
     if (null == obj)
     {
         throw new ArgumentNullException("obj");
     }
     obj.SetValue(UriSourceProperty, value);
 }
Beispiel #6
0
 public static string GetUriSource(SmartImage obj)
 {
     if (null == obj)
     {
         throw new ArgumentNullException("obj");
     }
     return((string)obj.GetValue(UriSourceProperty));
 }
Beispiel #7
0
 internal void AddSmartImage(SmartImage image)
 {
     smartImageList.Add(image);
     image.Proxy = this;
     if (isImageReady)
     {
         LoadingCompleted(this, null);
     }
 }
Beispiel #8
0
 void Page1_Loaded(object sender, RoutedEventArgs e)
 {
     for (int i = 0; i < 3; i++)
     {
         var a = new SmartImage();
         //ImageResourceManager.SetUriSource(a, S1Parser.S1Resource.EmotionBase + "face/fake.jpg");
         ImageResourceManager.SetUriSource(a, "http://ww2.sinaimg.cn/bmiddle/9941abc6gw1e239z973nwj.jpg");
         //ImageResourceManager.SetUriSource(a, "http://rack.0.mshcdn.com/media/ZgkyMDEzLzAxLzMwLzIzL0xpZ2h0UmVmcmFjLmRhZjE3LmdpZg/674a0906/aea/Light-Refraction.gif");
         //ImageResourceManager.SetUriSource(a, "http://ww3.sinaimg.cn/bmiddle/64112046jw1e2cv7zkejbg.gif");
         //ImageResourceManager.SetUriSource(a, "http://ww1.sinaimg.cn/bmiddle/64112046jw1e24rf0j1ehg.gif");
         Panel.Children.Add(a);
     }
 }
Beispiel #9
0
        private static SmartImage BuildImgControl(HtmlElement item)
        {
            //TODO: crash @ http://imgsrc.baidu.com/forum/w%3D580%3Bcp%3Dtieba%2C10%2C666%3Bap%3Dsnh48%B0%C9%2C90%2C674/sign=d10ca71e0b24ab18e016e13f05c185bd/42a0283fb80e7becd78d41d92d2eb9389a506bd0.jpg 
            var url = Uri.UnescapeDataString(item.Attributes["src"]);
            if (url == null) return null;

            S1Resource.GetAbsoluteUrl(ref url);
            bool isEmotion = S1Resource.IsEmotion(url);

            var image = new SmartImage ();
            ImageResourceManager.SetUriSource(image, url);
            if (isEmotion)
                image.Margin = new Thickness(0, 0, 0, -6);
            else
                image.Margin = new Thickness(6);
            return image;
        }
Beispiel #10
0
 internal void RemoveSmartImage(SmartImage image)
 {
     if (image != null && smartImageList.Contains(image))
         smartImageList.Remove(image);
 }
Beispiel #11
0
 internal void AddSmartImage(SmartImage image)
 {
     smartImageList.Add(image);
     image.Proxy = this;
     if (isImageReady)
     {
         LoadingCompleted(this, null);
     }
 }