Changeset 4548 for branches/OKB/HeuristicLab.Clients.OKB-3.3/Views
- Timestamp:
- 10/04/10 01:43:23 (14 years ago)
- 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 27 27 namespace HeuristicLab.Clients.OKB { 28 28 [View("OKB Administrator")] 29 [Content(typeof( Administrator), true)]29 [Content(typeof(OKB), true)] 30 30 public sealed partial class AdministratorView : AsynchronousContentView { 31 public new AdministratorContent {32 get { return ( Administrator)base.Content; }31 public new OKB Content { 32 get { return (OKB)base.Content; } 33 33 set { base.Content = value; } 34 34 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmDataView.cs
r4492 r4548 60 60 protected override void OnInitialized(System.EventArgs e) { 61 61 base.OnInitialized(e); 62 dataTypeComboBox.DataSource = Administrator.Instance.DataTypes.ToList();62 dataTypeComboBox.DataSource = OKB.Instance.DataTypes.ToList(); 63 63 dataTypeComboBox.SelectedIndex = -1; 64 64 } … … 80 80 noViewAvailableLabel.Visible = false; 81 81 } 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); 83 83 84 84 using (MemoryStream stream = new MemoryStream(Content.Data)) { … … 111 111 switch (e.PropertyName) { 112 112 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); 114 114 break; 115 115 } … … 119 119 BeginAsyncCall(); 120 120 var call = new Action(delegate() { 121 AlgorithmData data = Administrator.Instance.GetAlgorithmData(AlgorithmId);121 AlgorithmData data = OKB.Instance.GetAlgorithmData(AlgorithmId); 122 122 Content = data; 123 123 }); … … 142 142 } 143 143 } 144 Administrator.Instance.UpdateAlgorithmData(Content);144 OKB.Instance.UpdateAlgorithmData(Content); 145 145 } 146 146 private void newDataButton_Click(object sender, EventArgs e) { … … 153 153 if (Content == null) Content = new AlgorithmData { AlgorithmId = AlgorithmId }; 154 154 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); 156 156 if (dataType == null) { 157 157 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; 159 159 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(); 162 162 } 163 163 dataTypeComboBox.SelectedItem = dataType; … … 185 185 viewHost.Content = algorithm; 186 186 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); 188 188 if (dataType == null) { 189 189 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; 191 191 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(); 194 194 } 195 195 dataTypeComboBox.SelectedItem = dataType; -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmView.cs
r4492 r4548 42 42 protected override void OnInitialized(System.EventArgs e) { 43 43 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(); 46 46 } 47 47 … … 53 53 algorithmDataView.AlgorithmId = 0; 54 54 } 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); 57 57 algorithmDataView.AlgorithmId = Content.Id; 58 58 } … … 77 77 break; 78 78 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); 80 80 break; 81 81 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); 83 83 break; 84 84 } … … 99 99 100 100 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); 102 102 if (ids != null) { 103 List<User> users = Administrator.Instance.Users.ToList();103 List<User> users = OKB.Instance.Users.ToList(); 104 104 usersListBox.DataSource = users; 105 105 usersListBox.DisplayMember = "Name"; … … 112 112 } 113 113 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())) 115 115 storeUsersButton.Enabled = false; 116 116 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/DataTypeView.cs
r4492 r4548 41 41 protected override void OnInitialized(System.EventArgs e) { 42 42 base.OnInitialized(e); 43 platformComboBox.DataSource = Administrator.Instance.Platforms.ToList();43 platformComboBox.DataSource = OKB.Instance.Platforms.ToList(); 44 44 } 45 45 … … 57 57 nameTextBox.Text = Content.Name; 58 58 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); 60 60 Caption = Content.Name; 61 61 } … … 80 80 break; 81 81 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); 83 83 break; 84 84 } -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/ProblemDataView.cs
r4492 r4548 60 60 protected override void OnInitialized(System.EventArgs e) { 61 61 base.OnInitialized(e); 62 dataTypeComboBox.DataSource = Administrator.Instance.DataTypes.ToList();62 dataTypeComboBox.DataSource = OKB.Instance.DataTypes.ToList(); 63 63 dataTypeComboBox.SelectedIndex = -1; 64 64 } … … 80 80 noViewAvailableLabel.Visible = false; 81 81 } 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); 83 83 84 84 using (MemoryStream stream = new MemoryStream(Content.Data)) { … … 111 111 switch (e.PropertyName) { 112 112 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); 114 114 break; 115 115 } … … 119 119 BeginAsyncCall(); 120 120 var call = new Action(delegate() { 121 ProblemData data = Administrator.Instance.GetProblemData(ProblemId);121 ProblemData data = OKB.Instance.GetProblemData(ProblemId); 122 122 Content = data; 123 123 }); … … 141 141 } 142 142 } 143 Administrator.Instance.UpdateProblemData(Content);143 OKB.Instance.UpdateProblemData(Content); 144 144 } 145 145 private void newDataButton_Click(object sender, EventArgs e) { … … 152 152 if (Content == null) Content = new ProblemData { ProblemId = ProblemId }; 153 153 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); 155 155 if (dataType == null) { 156 156 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; 158 158 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(); 161 161 } 162 162 dataTypeComboBox.SelectedItem = dataType; … … 184 184 viewHost.Content = problem; 185 185 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); 187 187 if (dataType == null) { 188 188 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; 190 190 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(); 193 193 } 194 194 dataTypeComboBox.SelectedItem = dataType; -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/ProblemView.cs
r4492 r4548 42 42 protected override void OnInitialized(System.EventArgs e) { 43 43 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(); 46 46 } 47 47 … … 53 53 problemDataView.ProblemId = 0; 54 54 } 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); 57 57 problemDataView.ProblemId = Content.Id; 58 58 } … … 77 77 break; 78 78 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); 80 80 break; 81 81 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); 83 83 break; 84 84 } … … 99 99 100 100 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); 102 102 if (ids != null) { 103 List<User> users = Administrator.Instance.Users.ToList();103 List<User> users = OKB.Instance.Users.ToList(); 104 104 usersListBox.DataSource = users; 105 105 usersListBox.DisplayMember = "Name"; … … 112 112 } 113 113 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())) 115 115 storeUsersButton.Enabled = false; 116 116 }
Note: See TracChangeset
for help on using the changeset viewer.