public Window1() { InitializeComponent(); restClient = new RestServiceClient(); restClient.Proxy.Credentials = CredentialCache.DefaultCredentials; restClient.ServerUrl = Properties.Settings.Default.ServerAddress; if (String.IsNullOrEmpty(Properties.Settings.Default.ApplicationId) || String.IsNullOrEmpty(Properties.Settings.Default.Password)) { CredentialsInputDialog dialog = new CredentialsInputDialog(); dialog.ShowDialog(); Properties.Settings.Default.ApplicationId = dialog.ApplicationId.Text; Properties.Settings.Default.Password = dialog.Password.Text; Properties.Settings.Default.Save(); } restClient.ApplicationId = Properties.Settings.Default.ApplicationId; restClient.Password = Properties.Settings.Default.Password; restClientAsync = new RestServiceClientAsync(restClient); restClientAsync.UploadFileCompleted += UploadCompleted; restClientAsync.TaskProcessingCompleted += ProcessingCompleted; restClientAsync.DownloadFileCompleted += DownloadCompleted; restClientAsync.ListTasksCompleted += TaskListObtained; fieldLevelImage.RegionSelected += fieldSelected; }
private void changeAppIdAndPwd() { CredentialsInputDialog dialog = new CredentialsInputDialog(); if (this.IsActive) { dialog.Owner = this; } else { dialog.ShowInTaskbar = true; } dialog.ShowDialog(); if (dialog.DialogResult == true) { Properties.Settings.Default.ServerAddress = dialog.ServiceUrl.Text; Properties.Settings.Default.ApplicationId = dialog.ApplicationId.Text; Properties.Settings.Default.Password = dialog.Password.Text; Properties.Settings.Default.Save(); restClient.ApplicationId = Properties.Settings.Default.ApplicationId; restClient.Password = Properties.Settings.Default.Password; restClient.ServerUrl = Properties.Settings.Default.ServerAddress; } }
public Window1() { InitializeComponent(); restClient = new RestServiceClient(); restClient.Proxy.Credentials = CredentialCache.DefaultCredentials; restClient.ServerUrl = Properties.Settings.Default.ServerAddress; if (String.IsNullOrEmpty(Properties.Settings.Default.ApplicationId) || String.IsNullOrEmpty(Properties.Settings.Default.Password) ) { CredentialsInputDialog dialog = new CredentialsInputDialog(); dialog.ShowDialog(); Properties.Settings.Default.ApplicationId = dialog.ApplicationId.Text; Properties.Settings.Default.Password = dialog.Password.Text; Properties.Settings.Default.Save(); } restClient.ApplicationId = Properties.Settings.Default.ApplicationId; restClient.Password = Properties.Settings.Default.Password; restClientAsync = new RestServiceClientAsync(restClient); restClientAsync.UploadFileCompleted += UploadCompleted; restClientAsync.TaskProcessingCompleted += ProcessingCompleted; restClientAsync.DownloadFileCompleted += DownloadCompleted; restClientAsync.ListTasksCompleted += TaskListObtained; fieldLevelImage.RegionSelected += fieldSelected; }
private void changeAppIdAndPwd() { CredentialsInputDialog dialog = new CredentialsInputDialog(); dialog.ShowDialog(); if (dialog.DialogResult == true) { Properties.Settings.Default.ApplicationId = dialog.ApplicationId.Text; Properties.Settings.Default.Password = dialog.Password.Text; Properties.Settings.Default.Save(); restClient.ApplicationId = Properties.Settings.Default.ApplicationId; restClient.Password = Properties.Settings.Default.Password; } }