Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IAuthorizationState authorization = client.ProcessUserAuthorization();

            if (authorization == null)
            {
                client.RequestUserAuthorization(new Scope[] { Scope.ACCOUNTINFOFULL });
            }
            else
            {
                var accountInfo = client.AccountInformation(authorization.AccessToken);
                var table       = WebUIUtility.BuildFieldDescTable(
                    new Tuple <string, string>[] {
                    Tuple.Create("Id", accountInfo.Id),
                    Tuple.Create("Name", accountInfo.Name),
                    Tuple.Create("Latitude", accountInfo.Latitude.ToString()),
                    Tuple.Create("Longitude", accountInfo.Longitude.ToString()),
                    Tuple.Create("Type", accountInfo.Type.Value),
                    Tuple.Create("City", accountInfo.City),
                    Tuple.Create("State", accountInfo.State),
                }
                    );

                this.accountInfoHolder.Controls.Add(table);
                this.accountInfoHolder.Controls.Add(WebUIUtility.HorizontalLine());
            }
        }