Changeset 7665 for branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views/3.3/ProblemView.cs
- Timestamp:
- 03/27/12 13:31:44 (13 years ago)
- Location:
- branches/ProblemInstancesRegressionAndClassification
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemInstancesRegressionAndClassification
- Property svn:ignore
-
old new 3 3 protoc.exe 4 4 ProtoGen.exe 5 bin
-
- Property svn:ignore
-
branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views/3.3/ProblemView.cs
r7664 r7665 20 20 #endregion 21 21 22 using System.Linq; 22 23 using System.Windows.Forms; 23 24 using HeuristicLab.Core.Views; … … 46 47 protected override void OnContentChanged() { 47 48 base.OnContentChanged(); 48 //Check if IProblem implements IProblemInstancesConsumer interface 49 problemInstanceConsumerView.Content = (IProblemInstanceConsumer)Content; 50 problemInstanceSplitContainer.Panel1Collapsed = !problemInstanceConsumerView.ContainsProviders(); 49 if (Content != null && CheckForIProblemInstanceConsumer(Content)) { 50 problemInstanceConsumerView.Content = (IProblemInstanceConsumer)Content; 51 problemInstanceSplitContainer.Panel1Collapsed = !problemInstanceConsumerView.ContainsProviders(); 52 } else { 53 problemInstanceSplitContainer.Panel1Collapsed = true; 54 } 51 55 SetEnabledStateOfControls(); 52 56 } 53 57 54 protected override void SetEnabledStateOfControls() {55 base.SetEnabledStateOfControls();58 protected bool CheckForIProblemInstanceConsumer(IProblem Content) { 59 return Content.GetType().GetInterfaces().Any(x => x.IsInterface && x.Equals(typeof(IProblemInstanceConsumer))); 56 60 } 57 61 }
Note: See TracChangeset
for help on using the changeset viewer.