internal override void Execute()
        {
            var cmdlet = (RegisterTmxSystemUnderTestCommand)Cmdlet;
            var clientSettings = ClientSettings.Instance;
            clientSettings.ServerUrl = cmdlet.ServerUrl;
            clientSettings.StopImmediately = false;
            
            var registration = new Registration(new RestRequestCreator());
            // temporarily
            // TODO: to a template method
            var startTime = DateTime.Now;
            while (!clientSettings.StopImmediately) {
                // TODO: move to aspect
                try {
                    clientSettings.ClientId = registration.SendRegistrationInfoAndGetClientId(cmdlet.CustomClientString);
                }
                catch (Exception e2) {
Console.WriteLine("registering " + e2.Message);
                    // cmdlet.WriteProgress(new System.Management.Automation.ProgressRecord(
                }
                
                if (Guid.Empty != clientSettings.ClientId)
                    break;
                
                if (!cmdlet.Continuous)
                    if ((DateTime.Now - startTime).TotalSeconds >= cmdlet.Seconds)
                        throw new Exception("Failed to register client in " + cmdlet.Seconds + " seconds");
                
                Thread.Sleep(Preferences.ClientRegistrationSleepIntervalMilliseconds);
            }
            
            clientSettings.StopImmediately = false;
        }
예제 #2
0
 private void linkLabel1_TabIndexChanged(object sender, EventArgs e)
 {
     Registration myRegister = new Registration(S_Client);
     myRegister.ShowDialog();
 }
예제 #3
0
 private void linkLabel1_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
 {
     Registration myRegister = new Registration(S_Client);
     myRegister.ShowDialog();
     textBox1.Text = myRegister.user;
     textBox2.Text = myRegister.pass;
 }
예제 #4
0
 private void Label_MouseUp_1(object sender, MouseButtonEventArgs e)
 {
     Registration regW = new Registration();
     regW.Show();
     this.Close();
 }