Пример #1
0
        /// <summary>
        /// Load the profile information
        /// </summary>
        /// <param name="updateShell"></param>
        /// <param name="profileUrl"></param>
        public async void LoadProfileInfo(bool updateShell, string profileUrl = DefaultProfileUrl)
        {
            ProgressRingIsActive = true;
            if (HttpRequest.HasInternet())
            {
                var    parsHtml             = new Onliner.ParsingHtml.ParsingHtml();
                string resultGetHttpRequest = await HttpRequest.GetRequestOnlinerAsync(profileUrl);

                resultat.LoadHtml(resultGetHttpRequest);

                NickName = parsHtml.ParsElementHtml(accauntNameParsParam, resultat);
                Avatar   = parsHtml.ParsElementHtml(accauntImageParsParam, resultat);
                Status   = parsHtml.ParsElementHtml(accauntStatusParsParam, resultat);

                if (updateShell)
                {
                    ShellViewModel.Instance.AvatarUrl = Avatar;
                    ShellViewModel.Instance.Login     = NickName;
                    ShellViewModel.Instance.Status    = Status;
                    CommandButtonVisibility           = true;
                }

                SetProfileDataCollection(resultat);
                ProgressRingIsActive = false;
            }
            else
            {
                await HttpRequest.Message("Упс");
            }
        }
Пример #2
0
        /// <summary>
        /// Load the profile information
        /// </summary>
        /// <param name="updateShell"></param>
        /// <param name="profileUrl"></param>
        public async void LoadProfileInfo(bool updateShell, string profileUrl = DefaultProfileUrl)
        {
            ProgressRingIsActive = true;
            if (HttpRequest.HasInternet())
            {
                var parsHtml = new Onliner.ParsingHtml.ParsingHtml();
                string resultGetHttpRequest = await HttpRequest.GetRequestOnlinerAsync(profileUrl);
                resultat.LoadHtml(resultGetHttpRequest);

                NickName = parsHtml.ParsElementHtml(accauntNameParsParam, resultat);
                Avatar = parsHtml.ParsElementHtml(accauntImageParsParam, resultat);
                Status = parsHtml.ParsElementHtml(accauntStatusParsParam, resultat);

                if (updateShell)
                {
                    ShellViewModel.Instance.AvatarUrl = Avatar;
                    ShellViewModel.Instance.Login = NickName;
                    ShellViewModel.Instance.Status = Status;
                    CommandButtonVisibility = true;
                }

                SetProfileDataCollection(resultat);
                ProgressRingIsActive = false;
            }
            else
            {
                await HttpRequest.Message("Упс");
            }
        }