Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/04/10 01:43:23 (14 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

Location:
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AdministratorView.cs

    r4481 r4548  
    2727namespace HeuristicLab.Clients.OKB {
    2828  [View("OKB Administrator")]
    29   [Content(typeof(Administrator), true)]
     29  [Content(typeof(OKB), true)]
    3030  public sealed partial class AdministratorView : AsynchronousContentView {
    31     public new Administrator Content {
    32       get { return (Administrator)base.Content; }
     31    public new OKB Content {
     32      get { return (OKB)base.Content; }
    3333      set { base.Content = value; }
    3434    }
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmDataView.cs

    r4492 r4548  
    6060    protected override void OnInitialized(System.EventArgs e) {
    6161      base.OnInitialized(e);
    62       dataTypeComboBox.DataSource = Administrator.Instance.DataTypes.ToList();
     62      dataTypeComboBox.DataSource = OKB.Instance.DataTypes.ToList();
    6363      dataTypeComboBox.SelectedIndex = -1;
    6464    }
     
    8080        noViewAvailableLabel.Visible = false;
    8181      } else {
    82         dataTypeComboBox.SelectedItem = Administrator.Instance.DataTypes.FirstOrDefault(d => d.Id == Content.DataTypeId);
     82        dataTypeComboBox.SelectedItem = OKB.Instance.DataTypes.FirstOrDefault(d => d.Id == Content.DataTypeId);
    8383
    8484        using (MemoryStream stream = new MemoryStream(Content.Data)) {
     
    111111      switch (e.PropertyName) {
    112112        case "DataTypeId":
    113           dataTypeComboBox.SelectedItem = Administrator.Instance.DataTypes.FirstOrDefault(d => d.Id == Content.DataTypeId);
     113          dataTypeComboBox.SelectedItem = OKB.Instance.DataTypes.FirstOrDefault(d => d.Id == Content.DataTypeId);
    114114          break;
    115115      }
     
    119119      BeginAsyncCall();
    120120      var call = new Action(delegate() {
    121         AlgorithmData data = Administrator.Instance.GetAlgorithmData(AlgorithmId);
     121        AlgorithmData data = OKB.Instance.GetAlgorithmData(AlgorithmId);
    122122        Content = data;
    123123      });
     
    142142        }
    143143      }
    144       Administrator.Instance.UpdateAlgorithmData(Content);
     144      OKB.Instance.UpdateAlgorithmData(Content);
    145145    }
    146146    private void newDataButton_Click(object sender, EventArgs e) {
     
    153153            if (Content == null) Content = new AlgorithmData { AlgorithmId = AlgorithmId };
    154154            viewHost.Content = (IContent)dialog.TypeSelector.CreateInstanceOfSelectedType();
    155             DataType dataType = Administrator.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName);
     155            DataType dataType = OKB.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName);
    156156            if (dataType == null) {
    157157              dataType = new DataType { Name = viewHost.Content.GetType().AssemblyQualifiedName, SqlName = "varbinary" };
    158               dataType.PlatformId = Administrator.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id;
     158              dataType.PlatformId = OKB.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id;
    159159              dataType.Store();
    160               Administrator.Instance.DataTypes.Add(dataType);
    161               dataTypeComboBox.DataSource = Administrator.Instance.DataTypes.OrderBy(d => d.Name).ToList();
     160              OKB.Instance.DataTypes.Add(dataType);
     161              dataTypeComboBox.DataSource = OKB.Instance.DataTypes.OrderBy(d => d.Name).ToList();
    162162            }
    163163            dataTypeComboBox.SelectedItem = dataType;
     
    185185            viewHost.Content = algorithm;
    186186            noViewAvailableLabel.Visible = false;
    187             DataType dataType = Administrator.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName);
     187            DataType dataType = OKB.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName);
    188188            if (dataType == null) {
    189189              dataType = new DataType { Name = viewHost.Content.GetType().AssemblyQualifiedName, SqlName = "varbinary" };
    190               dataType.PlatformId = Administrator.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id;
     190              dataType.PlatformId = OKB.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id;
    191191              dataType.Store();
    192               Administrator.Instance.DataTypes.Add(dataType);
    193               dataTypeComboBox.DataSource = Administrator.Instance.DataTypes.OrderBy(d => d.Name).ToList();
     192              OKB.Instance.DataTypes.Add(dataType);
     193              dataTypeComboBox.DataSource = OKB.Instance.DataTypes.OrderBy(d => d.Name).ToList();
    194194            }
    195195            dataTypeComboBox.SelectedItem = dataType;
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmView.cs

    r4492 r4548  
    4242    protected override void OnInitialized(System.EventArgs e) {
    4343      base.OnInitialized(e);
    44       platformComboBox.DataSource = Administrator.Instance.Platforms.ToList();
    45       algorithmClassComboBox.DataSource = Administrator.Instance.AlgorithmClasses.ToList();
     44      platformComboBox.DataSource = OKB.Instance.Platforms.ToList();
     45      algorithmClassComboBox.DataSource = OKB.Instance.AlgorithmClasses.ToList();
    4646    }
    4747
     
    5353        algorithmDataView.AlgorithmId = 0;
    5454      } else {
    55         platformComboBox.SelectedItem = Administrator.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
    56         algorithmClassComboBox.SelectedItem = Administrator.Instance.AlgorithmClasses.FirstOrDefault(a => a.Id == Content.AlgorithmClassId);
     55        platformComboBox.SelectedItem = OKB.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
     56        algorithmClassComboBox.SelectedItem = OKB.Instance.AlgorithmClasses.FirstOrDefault(a => a.Id == Content.AlgorithmClassId);
    5757        algorithmDataView.AlgorithmId = Content.Id;
    5858      }
     
    7777          break;
    7878        case "PlatformId":
    79           platformComboBox.SelectedItem = Administrator.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
     79          platformComboBox.SelectedItem = OKB.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
    8080          break;
    8181        case "AlgorithmClassId":
    82           algorithmClassComboBox.SelectedItem = Administrator.Instance.AlgorithmClasses.FirstOrDefault(a => a.Id == Content.AlgorithmClassId);
     82          algorithmClassComboBox.SelectedItem = OKB.Instance.AlgorithmClasses.FirstOrDefault(a => a.Id == Content.AlgorithmClassId);
    8383          break;
    8484      }
     
    9999
    100100    private void refreshUsersButton_Click(object sender, System.EventArgs e) {
    101       Guid[] ids = Administrator.Instance.GetAlgorithmUsers(Content.Id);
     101      Guid[] ids = OKB.Instance.GetAlgorithmUsers(Content.Id);
    102102      if (ids != null) {
    103         List<User> users = Administrator.Instance.Users.ToList();
     103        List<User> users = OKB.Instance.Users.ToList();
    104104        usersListBox.DataSource = users;
    105105        usersListBox.DisplayMember = "Name";
     
    112112    }
    113113    private void storeUsersButton_Click(object sender, System.EventArgs e) {
    114       if (Administrator.Instance.UpdateAlgorithmUsers(Content.Id, usersListBox.SelectedItems.Cast<User>().Select(u => u.Id).ToArray()))
     114      if (OKB.Instance.UpdateAlgorithmUsers(Content.Id, usersListBox.SelectedItems.Cast<User>().Select(u => u.Id).ToArray()))
    115115        storeUsersButton.Enabled = false;
    116116    }
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/DataTypeView.cs

    r4492 r4548  
    4141    protected override void OnInitialized(System.EventArgs e) {
    4242      base.OnInitialized(e);
    43       platformComboBox.DataSource = Administrator.Instance.Platforms.ToList();
     43      platformComboBox.DataSource = OKB.Instance.Platforms.ToList();
    4444    }
    4545
     
    5757        nameTextBox.Text = Content.Name;
    5858        sqlNameComboBox.Text = Content.SqlName;
    59         platformComboBox.SelectedItem = Administrator.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
     59        platformComboBox.SelectedItem = OKB.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
    6060        Caption = Content.Name;
    6161      }
     
    8080          break;
    8181        case "PlatformId":
    82           platformComboBox.SelectedItem = Administrator.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
     82          platformComboBox.SelectedItem = OKB.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
    8383          break;
    8484      }
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/ProblemDataView.cs

    r4492 r4548  
    6060    protected override void OnInitialized(System.EventArgs e) {
    6161      base.OnInitialized(e);
    62       dataTypeComboBox.DataSource = Administrator.Instance.DataTypes.ToList();
     62      dataTypeComboBox.DataSource = OKB.Instance.DataTypes.ToList();
    6363      dataTypeComboBox.SelectedIndex = -1;
    6464    }
     
    8080        noViewAvailableLabel.Visible = false;
    8181      } else {
    82         dataTypeComboBox.SelectedItem = Administrator.Instance.DataTypes.FirstOrDefault(d => d.Id == Content.DataTypeId);
     82        dataTypeComboBox.SelectedItem = OKB.Instance.DataTypes.FirstOrDefault(d => d.Id == Content.DataTypeId);
    8383
    8484        using (MemoryStream stream = new MemoryStream(Content.Data)) {
     
    111111      switch (e.PropertyName) {
    112112        case "DataTypeId":
    113           dataTypeComboBox.SelectedItem = Administrator.Instance.DataTypes.FirstOrDefault(d => d.Id == Content.DataTypeId);
     113          dataTypeComboBox.SelectedItem = OKB.Instance.DataTypes.FirstOrDefault(d => d.Id == Content.DataTypeId);
    114114          break;
    115115      }
     
    119119      BeginAsyncCall();
    120120      var call = new Action(delegate() {
    121         ProblemData data = Administrator.Instance.GetProblemData(ProblemId);
     121        ProblemData data = OKB.Instance.GetProblemData(ProblemId);
    122122        Content = data;
    123123      });
     
    141141        }
    142142      }
    143       Administrator.Instance.UpdateProblemData(Content);
     143      OKB.Instance.UpdateProblemData(Content);
    144144    }
    145145    private void newDataButton_Click(object sender, EventArgs e) {
     
    152152            if (Content == null) Content = new ProblemData { ProblemId = ProblemId };
    153153            viewHost.Content = (IContent)dialog.TypeSelector.CreateInstanceOfSelectedType();
    154             DataType dataType = Administrator.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName);
     154            DataType dataType = OKB.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName);
    155155            if (dataType == null) {
    156156              dataType = new DataType { Name = viewHost.Content.GetType().AssemblyQualifiedName, SqlName = "varbinary" };
    157               dataType.PlatformId = Administrator.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id;
     157              dataType.PlatformId = OKB.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id;
    158158              dataType.Store();
    159               Administrator.Instance.DataTypes.Add(dataType);
    160               dataTypeComboBox.DataSource = Administrator.Instance.DataTypes.OrderBy(d => d.Name).ToList();
     159              OKB.Instance.DataTypes.Add(dataType);
     160              dataTypeComboBox.DataSource = OKB.Instance.DataTypes.OrderBy(d => d.Name).ToList();
    161161            }
    162162            dataTypeComboBox.SelectedItem = dataType;
     
    184184            viewHost.Content = problem;
    185185            noViewAvailableLabel.Visible = false;
    186             DataType dataType = Administrator.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName);
     186            DataType dataType = OKB.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName);
    187187            if (dataType == null) {
    188188              dataType = new DataType { Name = viewHost.Content.GetType().AssemblyQualifiedName, SqlName = "varbinary" };
    189               dataType.PlatformId = Administrator.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id;
     189              dataType.PlatformId = OKB.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id;
    190190              dataType.Store();
    191               Administrator.Instance.DataTypes.Add(dataType);
    192               dataTypeComboBox.DataSource = Administrator.Instance.DataTypes.OrderBy(d => d.Name).ToList();
     191              OKB.Instance.DataTypes.Add(dataType);
     192              dataTypeComboBox.DataSource = OKB.Instance.DataTypes.OrderBy(d => d.Name).ToList();
    193193            }
    194194            dataTypeComboBox.SelectedItem = dataType;
  • branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/ProblemView.cs

    r4492 r4548  
    4242    protected override void OnInitialized(System.EventArgs e) {
    4343      base.OnInitialized(e);
    44       platformComboBox.DataSource = Administrator.Instance.Platforms.ToList();
    45       problemClassComboBox.DataSource = Administrator.Instance.ProblemClasses.ToList();
     44      platformComboBox.DataSource = OKB.Instance.Platforms.ToList();
     45      problemClassComboBox.DataSource = OKB.Instance.ProblemClasses.ToList();
    4646    }
    4747
     
    5353        problemDataView.ProblemId = 0;
    5454      } else {
    55         platformComboBox.SelectedItem = Administrator.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
    56         problemClassComboBox.SelectedItem = Administrator.Instance.ProblemClasses.FirstOrDefault(a => a.Id == Content.ProblemClassId);
     55        platformComboBox.SelectedItem = OKB.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
     56        problemClassComboBox.SelectedItem = OKB.Instance.ProblemClasses.FirstOrDefault(a => a.Id == Content.ProblemClassId);
    5757        problemDataView.ProblemId = Content.Id;
    5858      }
     
    7777          break;
    7878        case "PlatformId":
    79           platformComboBox.SelectedItem = Administrator.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
     79          platformComboBox.SelectedItem = OKB.Instance.Platforms.FirstOrDefault(p => p.Id == Content.PlatformId);
    8080          break;
    8181        case "ProblemClassId":
    82           problemClassComboBox.SelectedItem = Administrator.Instance.ProblemClasses.FirstOrDefault(a => a.Id == Content.ProblemClassId);
     82          problemClassComboBox.SelectedItem = OKB.Instance.ProblemClasses.FirstOrDefault(a => a.Id == Content.ProblemClassId);
    8383          break;
    8484      }
     
    9999
    100100    private void refreshUsersButton_Click(object sender, System.EventArgs e) {
    101       Guid[] ids = Administrator.Instance.GetProblemUsers(Content.Id);
     101      Guid[] ids = OKB.Instance.GetProblemUsers(Content.Id);
    102102      if (ids != null) {
    103         List<User> users = Administrator.Instance.Users.ToList();
     103        List<User> users = OKB.Instance.Users.ToList();
    104104        usersListBox.DataSource = users;
    105105        usersListBox.DisplayMember = "Name";
     
    112112    }
    113113    private void storeUsersButton_Click(object sender, System.EventArgs e) {
    114       if (Administrator.Instance.UpdateProblemUsers(Content.Id, usersListBox.SelectedItems.Cast<User>().Select(u => u.Id).ToArray()))
     114      if (OKB.Instance.UpdateProblemUsers(Content.Id, usersListBox.SelectedItems.Cast<User>().Select(u => u.Id).ToArray()))
    115115        storeUsersButton.Enabled = false;
    116116    }
Note: See TracChangeset for help on using the changeset viewer.