示例#1
0
        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;
        }
示例#2
0
        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;
            }
        }
示例#3
0
        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;
        }
示例#4
0
        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;
            }
        }
示例#5
0
        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;
            }
        }