/// <summary> /// Complete Constructor /// </summary> /// <param name="hostUrl"></param> /// <param name="userName"></param> /// <param name="password"></param> /// <param name="updateFrequency"></param> public BUPIDClientWindow(String hostUrl, String userName, String password, int updateFrequency) { InitializeComponent(); Controller = new BUPIDClientController(userName, password, new Uri(hostUrl)); LoggedInLabel.DataBindings.Add(new Binding("Text", Controller, "UserEmail")); UploadFileButton.DataBindings.Add(new Binding("Enabled", Controller, "IsAuthenticated")); Controller.JobListUpdated += new PropertyChangedEventHandler(UpdateJobListView); //Configure polling frequency ServerUpdatePollingTimer = new Timer(); //Time in seconds ServerUpdatePollingTimer.Interval = 1000 * updateFrequency; ServerUpdatePollingTimer.Tick += UpdateTimer_Tick; ServerUpdatePollingTimer.Start(); //Detect changes to the user's settings options Properties.Settings.Default.PropertyChanged += Default_PropertyChanged; }
public JobDisplayItem(JobModel job, BUPIDClientController controller) { InitializeComponent(); this.Dock = DockStyle.Fill; this.Job = job; Console.WriteLine(Job.JobName); this.JobNameLabel.Text = job.JobName + " (" + job.State.ToString() + ")"; this.Controller = controller; if (job.State == JobState.Running) { RequestProcessingButton.Enabled = false; } DownloadResultsButton.Visible = false; if (job.State == JobState.Complete) { DownloadResultsButton.Visible = true; RequestProcessingButton.Enabled = false; } }