Beispiel #1
0
 //收藏图片
 public StarClass(Yande_post_json content)
 {
 }
Beispiel #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Window.Current.SetTitleBar(MyTitleBar);
            base.OnNavigatedTo(e);
            SetText();
            #region new
            var type = e.Parameter.GetType();
            if (type.Name == "Yande_post_json")
            {
                yande_parameter = (Yande_post_json)e.Parameter;
                img_sample_url  = yande_parameter.sample_url;
                BitmapImage bitmapimage = new BitmapImage(new Uri(yande_parameter.sample_url));
                SeeImage.Source = bitmapimage;
                bitmapimage.DownloadProgress += Bitmapimage_DownloadProgress;
                imguri       = yande_parameter.file_url;
                ImageID.Text = yande_parameter.id.ToString();
                imgid        = int.Parse(yande_parameter.id.ToString());
                //获取到一个奇怪的不完整路径
                var bitf = bitmapimage.UriSource.AbsolutePath;
                imgLocalpath = bitmapimage.UriSource.LocalPath;
                // 处理tag
                TagFuntion(yande_parameter.tags);
                //处理来源
                source = yande_parameter.source;
                //   "/sample/78cd441063dd0dab7e88f94ab7ab8cd6/yande.re 395326 sample hatsune_miku lepoule_(kmjh90) vocaloid.jpg"
                #region 获取信息
                GetImgData(yande_parameter.author, yande_parameter.jpeg_width, yande_parameter.jpeg_Height);
                #endregion
                #region 是喜欢的嘛
                try
                {
                    if (SettingHelper.Username_Yande != null)
                    {
                        pass_hash = HttpHelper.Hashpass("choujin-steiner--" + SettingHelper.UserPass_Yande + "--");
                        isfavourite(pass_hash);
                    }
                }
                catch { }

                #endregion
            }
            else if (type.Name == "Konachan_post_json")
            {
                Konachan_parameter = (Konachan_post_json)e.Parameter;
                img_sample_url     = Konachan_parameter.sample_url;
                Star.Visibility    = Visibility.Collapsed;
                BitmapImage bitmapimage = new BitmapImage(new Uri(Konachan_parameter.sample_url));
                SeeImage.Source = bitmapimage;
                bitmapimage.DownloadProgress += Bitmapimage_DownloadProgress;
                imguri       = Konachan_parameter.file_url;
                ImageID.Text = Konachan_parameter.id.ToString();
                imgid        = int.Parse(Konachan_parameter.id.ToString());
                //获取到一个奇怪的不完整路径
                var bitf = bitmapimage.UriSource.AbsolutePath;
                imgLocalpath = bitmapimage.UriSource.LocalPath;
                // 处理tag
                TagFuntion(Konachan_parameter.tags);
                //处理来源
                source = Konachan_parameter.source;
            }
            else
            {
                #region 旧的
                ItemGET.listsave lookit2 = (ItemGET.listsave)e.Parameter;
                bitmapimage     = new BitmapImage(new Uri(lookit2.sample_url));
                SeeImage.Source = bitmapimage;
                bitmapimage.DownloadProgress += Bitmapimage_DownloadProgress;
                imguri       = lookit2.imguri;
                ImageID.Text = lookit2.id;
                imgid        = int.Parse(lookit2.id);
                #endregion
            }
            GetSource(source);
            #endregion
            #region 旧的
            //try
            //{
            //    base.OnNavigatedTo(e);
            //    Lookimgclass lookit = (Lookimgclass)e.Parameter;
            //    var sample_url = lookit.lookimguri;

            //    //var value = (string)e.Parameter;
            //    //setall.sample_url = value;
            //    BitmapImage bitmapimage = new BitmapImage(new Uri(sample_url));
            //    bitmapimage.DownloadProgress += Bitmapimage_DownloadProgress;
            //    SeeImage.Source = bitmapimage;
            //    a = lookit.b;
            //    imguri = lookit.jpegurl[a];
            //    imgname = lookit.thisname[a];
            //    imgid = int.Parse(lookit._id[a]);
            //}
            //catch
            //{

            //}
            #endregion
        }