Exemplo n.º 1
0
        private void lnkTMDbStart_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (!string.IsNullOrEmpty(AppSettings.TMDbRequestToken) || !string.IsNullOrEmpty(AppSettings.TMDbSessionId))
            {
                AppSettings.TMDbRequestToken = string.Empty;
                AppSettings.TMDbSessionId    = string.Empty;
                SetTMDbControlState();
                return;
            }

            Thread tokenThread = new Thread(o =>
            {
                // store token and parse into tmdb object later
                // for request session id
                string requestToken = TMDb.RequestToken();

                if (!string.IsNullOrEmpty(requestToken))
                {
                    TMDb.RequestAuthorization(requestToken);
                    AppSettings.TMDbRequestToken = requestToken;
                    SetTMDbControlState();
                }
            });

            tokenThread.Start();
        }