private async Task ExecuteGetFavCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            GetFavoriteListCommand.ChangeCanExecute();

            try
            {
                var favList = await FavoriteDataService.GetFavListHistory();

                if (favList != null)
                {
                    foreach (var item in favList)
                    {
                        FavList.Add(item);
                    }
                }

                IsBusy = false;
            }
            catch (Exception ex)
            {
            }
        }
示例#2
0
        public static bool GenerateFavList()
        {
            if (FavList == null)
            {
                FavList = new BindingList <Server>();
                FavList.RaiseListChangedEvents = true;
            }

            FavList.Clear();

            try
            {
                foreach (XElement xel in _FavFile.Root.Descendants("server"))
                {
                    try
                    {
                        FavList.Add(new Server(xel.Element("ip").Value, xel.Element("nickname").Value));
                    }
                    finally { }
                }
                return(true);
            }
            finally
            {
            }
        }
示例#3
0
        /// <summary>
        /// 마이리스트 조회
        /// </summary>
        public void InitMyList()
        {
            //로그인 예외처리
            //테스트 끝나면 풀것
            if (null == MainViewModel.LoginUser)
            {
                return;
            }

            DataSet dsResult = new DataSet();

            dsResult = callQuery.S_MA_USR_FAV_LIST(MainViewModel.LoginUser.USER_NO);
            //dsResult = callQuery.S_MA_USR_FAV_LIST("wildowl");

            if (0 == dsResult.Tables.Count)
            {
                return;
            }

            FavList.Clear();
            foreach (DataRow item in dsResult.Tables[0].Rows)
            {
                UdtMyListItem myItem = new UdtMyListItem();

                myItem.ContentID   = item["CONS_ID"].ToString();
                myItem.ContentName = item["CONS_NM"].ToString();

                System.Drawing.Image thumbImg = IMRUtils.TypeParser.ByteArrayToImage(Convert.FromBase64String(item["CONS_THUMB_PATH"].ToString()));
                myItem.ContentThumbnail = StaticUtils.ImageToImageSource(thumbImg);

                myItem.ContentType = item["CONS_TP"].ToString();
                myItem.EnterDtm    = item["FAV_DTM"].ToString();
                myItem.Deleterable = System.Windows.Visibility.Visible;

                FavList.Add(myItem);
            }
        }