예제 #1
0
        private async void AuthorizationTokenChanged(object sender, EventArgs e)
        {
            string UserKey;
            string ElementKey;
            string ExtraThing;

            UserKey    = txtUserKey.Text;
            ElementKey = txtElementKey.Text;
            ExtraThing = txtExtraThing.Text;

            if ((UserKey.Trim().Length > 0) && (ElementKey.Trim().Length > 0))
            {
                APIAuthorization = new Cloud_Elements_API.CloudAuthorization(ElementKey, UserKey);
                if (ExtraThing.Trim().Length > 0)
                {
                    APIAuthorization.ExtraValue = ExtraThing;
                }
                UIState(false);
                await PingService();

                tsBtnPing.Enabled = true;
            }
            else
            {
                StatusMsg("Both secrets are required");
            }
        }
예제 #2
0
        private async void LoadSecretsFromFile(string secretsFN)
        {
            APIAuthorization = new Cloud_Elements_API.CloudAuthorization(Cloud_Elements_API.Tools.FileToString(secretsFN));
            StatusMsg("Loaded secrets from " + secretsFN);
            this.Show();
            await PingService();

            Task ignoredRefreshFolderTask = RefreshCurrentFolder(); // very naughty, ignore exceptions; ref http://stackoverflow.com/questions/14903887/warning-this-call-is-not-awaited-execution-of-the-current-method-continues
        }