Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/09/11 02:08:07 (13 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views/OKBProblemView.cs

    r5639 r5640  
    2727using HeuristicLab.MainForm.WindowsForms;
    2828
    29 namespace HeuristicLab.Clients.OKB {
     29namespace HeuristicLab.Clients.OKB.RunCreation {
    3030  [View("OKBProblem View")]
    3131  [Content(typeof(OKBProblem), true)]
     
    4242    protected override void OnInitialized(System.EventArgs e) {
    4343      base.OnInitialized(e);
    44       OKBClient.Instance.Refreshing += new EventHandler(OKBClient_Refreshing);
    45       OKBClient.Instance.Refreshed += new EventHandler(OKBClient_Refreshed);
     44      RunCreationClient.Instance.Refreshing += new EventHandler(RunCreationClient_Refreshing);
     45      RunCreationClient.Instance.Refreshed += new EventHandler(RunCreationClient_Refreshed);
    4646      PopulateComboBox();
    4747    }
     
    6262        viewHost.Content = null;
    6363      } else {
    64         problemComboBox.SelectedItem = OKBClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId);
     64        problemComboBox.SelectedItem = RunCreationClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId);
    6565        viewHost.Content = Content.Problem;
    6666      }
     
    7474    private void PopulateComboBox() {
    7575      problemComboBox.DataSource = null;
    76       Platform platform = OKBClient.Instance.Platforms.FirstOrDefault(x => x.Name == "HeuristicLab 3.3");
    77       if (platform != null) {
    78         problemComboBox.DataSource = OKBClient.Instance.Problems.Where(x => x.PlatformId == platform.Id).ToList();
    79         problemComboBox.DisplayMember = "Name";
    80       }
     76      problemComboBox.DataSource = RunCreationClient.Instance.Problems.ToList();
     77      problemComboBox.DisplayMember = "Name";
    8178    }
    8279
    8380    protected override void OnClosed(FormClosedEventArgs e) {
    84       OKBClient.Instance.Refreshing -= new EventHandler(OKBClient_Refreshing);
    85       OKBClient.Instance.Refreshed -= new EventHandler(OKBClient_Refreshed);
     81      RunCreationClient.Instance.Refreshing -= new EventHandler(RunCreationClient_Refreshing);
     82      RunCreationClient.Instance.Refreshed -= new EventHandler(RunCreationClient_Refreshed);
    8683      base.OnClosed(e);
    8784    }
    8885
    89     private void OKBClient_Refreshing(object sender, EventArgs e) {
     86    private void RunCreationClient_Refreshing(object sender, EventArgs e) {
    9087      if (InvokeRequired) {
    91         Invoke(new EventHandler(OKBClient_Refreshing), sender, e);
     88        Invoke(new EventHandler(RunCreationClient_Refreshing), sender, e);
    9289      } else {
    9390        Cursor = Cursors.AppStarting;
     
    9592      }
    9693    }
    97     private void OKBClient_Refreshed(object sender, EventArgs e) {
     94    private void RunCreationClient_Refreshed(object sender, EventArgs e) {
    9895      if (InvokeRequired) {
    99         Invoke(new EventHandler(OKBClient_Refreshed), sender, e);
     96        Invoke(new EventHandler(RunCreationClient_Refreshed), sender, e);
    10097      } else {
    10198        PopulateComboBox();
     
    110107        Invoke(new EventHandler(Content_ProblemChanged), sender, e);
    111108      else {
    112         problemComboBox.SelectedItem = OKBClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId);
     109        problemComboBox.SelectedItem = RunCreationClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId);
    113110        viewHost.Content = Content.Problem;
    114111      }
     
    118115    #region Control Events
    119116    private void refreshButton_Click(object sender, System.EventArgs e) {
    120       OKBClient.Instance.Refresh();
     117      RunCreationClient.Instance.Refresh();
    121118    }
    122119    private void problemComboBox_SelectedValueChanged(object sender, System.EventArgs e) {
     
    125122        Content.Load(problem.Id);
    126123        if (Content.ProblemId != problem.Id)  // reset selected item if load was not successful
    127           problemComboBox.SelectedItem = OKBClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId);
     124          problemComboBox.SelectedItem = RunCreationClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId);
    128125      }
    129126    }
Note: See TracChangeset for help on using the changeset viewer.