Changeset 2687
- Timestamp:
- 01/27/10 03:55:16 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Common.Resources/3.2/HeuristicLab.Common.Resources-3.2.csproj
r2650 r2687 309 309 <None Include="Resources\VS2008ImageLibrary\VS2008ImageLibrary_Actions_Undo.png" /> 310 310 </ItemGroup> 311 <ItemGroup> 312 <None Include="Resources\VS2008ImageLibrary\VS2008ImageLibrary_Actions_Windows.png" /> 313 </ItemGroup> 311 314 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 312 315 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
trunk/sources/HeuristicLab.Common.Resources/3.2/VS2008ImageLibrary.Designer.cs
r2650 r2687 452 452 } 453 453 } 454 455 public static System.Drawing.Bitmap Windows { 456 get { 457 object obj = ResourceManager.GetObject("Windows", resourceCulture); 458 return ((System.Drawing.Bitmap)(obj)); 459 } 460 } 454 461 } 455 462 } -
trunk/sources/HeuristicLab.Common.Resources/3.2/VS2008ImageLibrary.resx
r2650 r2687 287 287 <value>Resources\VS2008ImageLibrary\VS2008ImageLibrary_Objects_ValueType.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 288 288 </data> 289 <data name="Windows" type="System.Resources.ResXFileRef, System.Windows.Forms"> 290 <value>Resources\VS2008ImageLibrary\VS2008ImageLibrary_Actions_Windows.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> 291 </data> 289 292 </root> -
trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.Designer.cs
r2676 r2687 48 48 this.executionTimeTextBox = new System.Windows.Forms.TextBox(); 49 49 this.executionTimeLabel = new System.Windows.Forms.Label(); 50 this.splitContainer = new System.Windows.Forms.SplitContainer();51 50 this.operatorGraphView = new HeuristicLab.Core.Views.OperatorGraphView(); 52 51 this.scopeView = new HeuristicLab.Core.Views.ScopeView(); … … 55 54 this.startButton = new System.Windows.Forms.Button(); 56 55 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 57 this.splitContainer.Panel1.SuspendLayout(); 58 this.splitContainer.Panel2.SuspendLayout(); 59 this.splitContainer.SuspendLayout(); 56 this.tabControl = new System.Windows.Forms.TabControl(); 57 this.operatorGraphTabPage = new System.Windows.Forms.TabPage(); 58 this.globalScopeTabPage = new System.Windows.Forms.TabPage(); 59 this.tabControl.SuspendLayout(); 60 this.operatorGraphTabPage.SuspendLayout(); 61 this.globalScopeTabPage.SuspendLayout(); 60 62 this.SuspendLayout(); 61 63 // … … 63 65 // 64 66 this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 65 this.executionTimeTextBox.Location = new System.Drawing.Point(6 55, 620);67 this.executionTimeTextBox.Location = new System.Drawing.Point(661, 620); 66 68 this.executionTimeTextBox.Name = "executionTimeTextBox"; 67 69 this.executionTimeTextBox.ReadOnly = true; 68 70 this.executionTimeTextBox.Size = new System.Drawing.Size(141, 20); 69 this.executionTimeTextBox.TabIndex = 4;71 this.executionTimeTextBox.TabIndex = 5; 70 72 // 71 73 // executionTimeLabel … … 73 75 this.executionTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 74 76 this.executionTimeLabel.AutoSize = true; 75 this.executionTimeLabel.Location = new System.Drawing.Point(5 66, 623);77 this.executionTimeLabel.Location = new System.Drawing.Point(572, 623); 76 78 this.executionTimeLabel.Name = "executionTimeLabel"; 77 79 this.executionTimeLabel.Size = new System.Drawing.Size(83, 13); 78 this.executionTimeLabel.TabIndex = 3;80 this.executionTimeLabel.TabIndex = 4; 79 81 this.executionTimeLabel.Text = "&Execution Time:"; 80 //81 // splitContainer82 //83 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)84 | System.Windows.Forms.AnchorStyles.Left)85 | System.Windows.Forms.AnchorStyles.Right)));86 this.splitContainer.Location = new System.Drawing.Point(0, 0);87 this.splitContainer.Name = "splitContainer";88 //89 // splitContainer.Panel190 //91 this.splitContainer.Panel1.Controls.Add(this.operatorGraphView);92 //93 // splitContainer.Panel294 //95 this.splitContainer.Panel2.Controls.Add(this.scopeView);96 this.splitContainer.Size = new System.Drawing.Size(802, 611);97 this.splitContainer.SplitterDistance = 401;98 this.splitContainer.TabIndex = 0;99 82 // 100 83 // operatorGraphView … … 105 88 this.operatorGraphView.Caption = "Operator Graph"; 106 89 this.operatorGraphView.Item = null; 107 this.operatorGraphView.Location = new System.Drawing.Point( 3, 3);90 this.operatorGraphView.Location = new System.Drawing.Point(6, 6); 108 91 this.operatorGraphView.Name = "operatorGraphView"; 109 92 this.operatorGraphView.Object = null; 110 93 this.operatorGraphView.OperatorGraph = null; 111 this.operatorGraphView.Size = new System.Drawing.Size( 395, 605);94 this.operatorGraphView.Size = new System.Drawing.Size(782, 573); 112 95 this.operatorGraphView.TabIndex = 0; 113 96 // … … 119 102 this.scopeView.Caption = "Scope"; 120 103 this.scopeView.Item = null; 121 this.scopeView.Location = new System.Drawing.Point( 3, 3);104 this.scopeView.Location = new System.Drawing.Point(6, 6); 122 105 this.scopeView.Name = "scopeView"; 123 106 this.scopeView.Object = null; 124 107 this.scopeView.Scope = null; 125 this.scopeView.Size = new System.Drawing.Size( 391, 605);108 this.scopeView.Size = new System.Drawing.Size(782, 573); 126 109 this.scopeView.TabIndex = 0; 127 110 // … … 130 113 this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 131 114 this.resetButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Restart; 132 this.resetButton.Location = new System.Drawing.Point( 63, 617);115 this.resetButton.Location = new System.Drawing.Point(58, 617); 133 116 this.resetButton.Name = "resetButton"; 134 117 this.resetButton.Size = new System.Drawing.Size(23, 23); 135 this.resetButton.TabIndex = 2;118 this.resetButton.TabIndex = 3; 136 119 this.toolTip.SetToolTip(this.resetButton, "Reset Engine"); 137 120 this.resetButton.UseVisualStyleBackColor = true; … … 143 126 this.stopButton.Enabled = false; 144 127 this.stopButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Stop; 145 this.stopButton.Location = new System.Drawing.Point( 34, 617);128 this.stopButton.Location = new System.Drawing.Point(29, 617); 146 129 this.stopButton.Name = "stopButton"; 147 130 this.stopButton.Size = new System.Drawing.Size(23, 23); 148 this.stopButton.TabIndex = 1;131 this.stopButton.TabIndex = 2; 149 132 this.toolTip.SetToolTip(this.stopButton, "Stop Engine"); 150 133 this.stopButton.UseVisualStyleBackColor = true; … … 155 138 this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 156 139 this.startButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Play; 157 this.startButton.Location = new System.Drawing.Point( 5, 617);140 this.startButton.Location = new System.Drawing.Point(0, 617); 158 141 this.startButton.Name = "startButton"; 159 142 this.startButton.Size = new System.Drawing.Size(23, 23); 160 this.startButton.TabIndex = 0;143 this.startButton.TabIndex = 1; 161 144 this.toolTip.SetToolTip(this.startButton, "Start Engine"); 162 145 this.startButton.UseVisualStyleBackColor = true; 163 146 this.startButton.Click += new System.EventHandler(this.startButton_Click); 164 147 // 148 // tabControl 149 // 150 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 151 | System.Windows.Forms.AnchorStyles.Left) 152 | System.Windows.Forms.AnchorStyles.Right))); 153 this.tabControl.Controls.Add(this.operatorGraphTabPage); 154 this.tabControl.Controls.Add(this.globalScopeTabPage); 155 this.tabControl.Location = new System.Drawing.Point(0, 0); 156 this.tabControl.Name = "tabControl"; 157 this.tabControl.SelectedIndex = 0; 158 this.tabControl.Size = new System.Drawing.Size(802, 611); 159 this.tabControl.TabIndex = 0; 160 // 161 // operatorGraphTabPage 162 // 163 this.operatorGraphTabPage.Controls.Add(this.operatorGraphView); 164 this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22); 165 this.operatorGraphTabPage.Name = "operatorGraphTabPage"; 166 this.operatorGraphTabPage.Padding = new System.Windows.Forms.Padding(3); 167 this.operatorGraphTabPage.Size = new System.Drawing.Size(794, 585); 168 this.operatorGraphTabPage.TabIndex = 0; 169 this.operatorGraphTabPage.Text = "Operator Graph"; 170 this.operatorGraphTabPage.UseVisualStyleBackColor = true; 171 // 172 // globalScopeTabPage 173 // 174 this.globalScopeTabPage.Controls.Add(this.scopeView); 175 this.globalScopeTabPage.Location = new System.Drawing.Point(4, 22); 176 this.globalScopeTabPage.Name = "globalScopeTabPage"; 177 this.globalScopeTabPage.Padding = new System.Windows.Forms.Padding(3); 178 this.globalScopeTabPage.Size = new System.Drawing.Size(794, 585); 179 this.globalScopeTabPage.TabIndex = 1; 180 this.globalScopeTabPage.Text = "Global Scope"; 181 this.globalScopeTabPage.UseVisualStyleBackColor = true; 182 // 165 183 // EngineView 166 184 // 167 185 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 168 186 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 187 this.Controls.Add(this.tabControl); 169 188 this.Controls.Add(this.executionTimeTextBox); 170 189 this.Controls.Add(this.stopButton); 171 190 this.Controls.Add(this.executionTimeLabel); 172 this.Controls.Add(this.splitContainer);173 191 this.Controls.Add(this.resetButton); 174 192 this.Controls.Add(this.startButton); 175 193 this.Name = "EngineView"; 176 194 this.Size = new System.Drawing.Size(802, 640); 177 this. splitContainer.Panel1.ResumeLayout(false);178 this. splitContainer.Panel2.ResumeLayout(false);179 this. splitContainer.ResumeLayout(false);195 this.tabControl.ResumeLayout(false); 196 this.operatorGraphTabPage.ResumeLayout(false); 197 this.globalScopeTabPage.ResumeLayout(false); 180 198 this.ResumeLayout(false); 181 199 this.PerformLayout(); … … 187 205 protected System.Windows.Forms.TextBox executionTimeTextBox; 188 206 protected System.Windows.Forms.Label executionTimeLabel; 189 protected System.Windows.Forms.SplitContainer splitContainer;190 207 protected System.Windows.Forms.Button resetButton; 191 208 protected System.Windows.Forms.Button stopButton; … … 194 211 protected HeuristicLab.Core.Views.ScopeView scopeView; 195 212 protected System.Windows.Forms.ToolTip toolTip; 213 protected System.Windows.Forms.TabControl tabControl; 214 protected System.Windows.Forms.TabPage operatorGraphTabPage; 215 protected System.Windows.Forms.TabPage globalScopeTabPage; 196 216 197 217 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ScopeListView.cs
r2655 r2687 12 12 namespace HeuristicLab.Core.Views { 13 13 [Content(typeof(ScopeList), true)] 14 [Content(typeof(IObservableList< Scope>), true)]15 public partial class ScopeListView : ItemListView< Scope> {14 [Content(typeof(IObservableList<IScope>), true)] 15 public partial class ScopeListView : ItemListView<IScope> { 16 16 /// <summary> 17 17 /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View". … … 28 28 /// <remarks>Calls <see cref="VariablesScopeView()"/>.</remarks> 29 29 /// <param name="scope">The scope whose variables should be represented visually.</param> 30 public ScopeListView(IObservableList< Scope> scopeList)30 public ScopeListView(IObservableList<IScope> scopeList) 31 31 : this() { 32 32 ItemList = scopeList; -
trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.cs
r2676 r2687 38 38 [Content(typeof(Scope), true)] 39 39 public sealed partial class ScopeView : ItemView { 40 private Dictionary< Scope, TreeNode> scopeNodeTable;41 private Dictionary<ScopeList, Scope> subScopesScopeTable;40 private Dictionary<IScope, TreeNode> scopeNodeTable; 41 private Dictionary<ScopeList, IScope> subScopesScopeTable; 42 42 43 43 /// <summary> … … 46 46 /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>. 47 47 /// No own data storage present.</remarks> 48 public Scope Scope {49 get { return ( Scope)Item; }48 public IScope Scope { 49 get { return (IScope)Item; } 50 50 set { base.Item = value; } 51 51 } … … 58 58 InitializeComponent(); 59 59 Caption = "Scope"; 60 scopeNodeTable = new Dictionary< Scope, TreeNode>();61 subScopesScopeTable = new Dictionary<ScopeList, Scope>();60 scopeNodeTable = new Dictionary<IScope, TreeNode>(); 61 subScopesScopeTable = new Dictionary<ScopeList, IScope>(); 62 62 63 63 } … … 67 67 /// <remarks>Calls <see cref="ScopeView()"/>.</remarks> 68 68 /// <param name="scope">The scope to represent visually.</param> 69 public ScopeView( Scope scope)69 public ScopeView(IScope scope) 70 70 : this() { 71 71 Scope = scope; … … 94 94 } 95 95 96 private TreeNode CreateTreeNode( Scope scope) {96 private TreeNode CreateTreeNode(IScope scope) { 97 97 TreeNode node = new TreeNode(); 98 98 node.Text = scope.Name; … … 101 101 scopeNodeTable.Add(scope, node); 102 102 scope.NameChanged += new EventHandler(Scope_NameChanged); 103 scope.SubScopes.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsAdded);104 scope.SubScopes.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsRemoved);105 scope.SubScopes.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsReplaced);106 scope.SubScopes.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsMoved);107 scope.SubScopes.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_CollectionReset);103 scope.SubScopes.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsAdded); 104 scope.SubScopes.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsRemoved); 105 scope.SubScopes.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsReplaced); 106 scope.SubScopes.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsMoved); 107 scope.SubScopes.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_CollectionReset); 108 108 subScopesScopeTable.Add(scope.SubScopes, scope); 109 109 if (scope.SubScopes.Count > 0) … … 116 116 RemoveTreeNode(child); 117 117 118 Scope scope = node.Tag asScope;118 IScope scope = node.Tag as IScope; 119 119 if (scope != null) { 120 120 scopeNodeTable.Remove(scope); 121 121 scope.NameChanged -= new EventHandler(Scope_NameChanged); 122 scope.SubScopes.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsAdded);123 scope.SubScopes.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsRemoved);124 scope.SubScopes.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsReplaced);125 scope.SubScopes.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsMoved);126 scope.SubScopes.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_CollectionReset);122 scope.SubScopes.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsAdded); 123 scope.SubScopes.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsRemoved); 124 scope.SubScopes.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsReplaced); 125 scope.SubScopes.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsMoved); 126 scope.SubScopes.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_CollectionReset); 127 127 subScopesScopeTable.Remove(scope.SubScopes); 128 128 } … … 132 132 private void scopesTreeView_MouseDown(object sender, MouseEventArgs e) { 133 133 TreeNode node = scopesTreeView.GetNodeAt(e.X, e.Y); 134 if ((node != null) && (node.Tag is Scope)) {135 variableCollectionView.NamedItemCollection = (( Scope)node.Tag).Variables;134 if ((node != null) && (node.Tag is IScope)) { 135 variableCollectionView.NamedItemCollection = ((IScope)node.Tag).Variables; 136 136 variableCollectionView.Enabled = true; 137 137 } else { … … 143 143 private void scopesTreeView_BeforeExpand(object sender, TreeViewCancelEventArgs e) { 144 144 TreeNode node = e.Node; 145 Scope scope = (Scope)node.Tag;145 IScope scope = (IScope)node.Tag; 146 146 147 147 node.Nodes.Clear(); … … 151 151 private void scopesTreeView_AfterCollapse(object sender, System.Windows.Forms.TreeViewEventArgs e) { 152 152 TreeNode node = e.Node; 153 Scope scope = (Scope)node.Tag;153 IScope scope = (IScope)node.Tag; 154 154 155 155 if (node.Nodes.Count > 0) { … … 162 162 private void scopesTreeView_ItemDrag(object sender, ItemDragEventArgs e) { 163 163 TreeNode node = (TreeNode)e.Item; 164 Scope scope = node.Tag asScope;164 IScope scope = node.Tag as IScope; 165 165 if (scope != null) { 166 166 DataObject data = new DataObject(); … … 177 177 Invoke(new EventHandler(Scope_NameChanged), sender, e); 178 178 else { 179 Scope scope = (Scope)sender;179 IScope scope = (IScope)sender; 180 180 scopeNodeTable[scope].Text = scope.Name; 181 181 } … … 184 184 185 185 #region SubScopes Events 186 private void SubScopes_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {187 if (InvokeRequired) 188 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsAdded), sender, e);189 else { 190 Scope parentScope = subScopesScopeTable[(ScopeList)sender];191 TreeNode parentNode = scopeNodeTable[parentScope]; 192 if (parentNode.IsExpanded) { 193 foreach (IndexedItem< Scope> item in e.Items) {186 private void SubScopes_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 187 if (InvokeRequired) 188 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsAdded), sender, e); 189 else { 190 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 191 TreeNode parentNode = scopeNodeTable[parentScope]; 192 if (parentNode.IsExpanded) { 193 foreach (IndexedItem<IScope> item in e.Items) { 194 194 TreeNode node = CreateTreeNode(item.Value); 195 195 parentNode.Nodes.Insert(item.Index, node); … … 200 200 } 201 201 } 202 private void SubScopes_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {203 if (InvokeRequired) 204 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsRemoved), sender, e);205 else { 206 Scope parentScope = subScopesScopeTable[(ScopeList)sender];207 TreeNode parentNode = scopeNodeTable[parentScope]; 208 if (parentNode.IsExpanded) { 209 foreach (IndexedItem< Scope> item in e.Items) {202 private void SubScopes_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 203 if (InvokeRequired) 204 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsRemoved), sender, e); 205 else { 206 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 207 TreeNode parentNode = scopeNodeTable[parentScope]; 208 if (parentNode.IsExpanded) { 209 foreach (IndexedItem<IScope> item in e.Items) { 210 210 TreeNode node = scopeNodeTable[item.Value]; 211 211 RemoveTreeNode(node); … … 217 217 } 218 218 } 219 private void SubScopes_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {220 if (InvokeRequired) 221 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsReplaced), sender, e);222 else { 223 Scope parentScope = subScopesScopeTable[(ScopeList)sender];224 TreeNode parentNode = scopeNodeTable[parentScope]; 225 if (parentNode.IsExpanded) { 226 foreach (IndexedItem< Scope> item in e.Items) {219 private void SubScopes_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 220 if (InvokeRequired) 221 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsReplaced), sender, e); 222 else { 223 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 224 TreeNode parentNode = scopeNodeTable[parentScope]; 225 if (parentNode.IsExpanded) { 226 foreach (IndexedItem<IScope> item in e.Items) { 227 227 TreeNode node = parentNode.Nodes[item.Index]; 228 228 RemoveTreeNode(node); … … 234 234 } 235 235 } 236 private void SubScopes_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {237 if (InvokeRequired) 238 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsMoved), sender, e);239 else { 240 Scope parentScope = subScopesScopeTable[(ScopeList)sender];241 TreeNode parentNode = scopeNodeTable[parentScope]; 242 if (parentNode.IsExpanded) { 243 parentNode.Nodes.Clear(); 244 foreach (IndexedItem< Scope> item in e.Items)236 private void SubScopes_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 237 if (InvokeRequired) 238 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsMoved), sender, e); 239 else { 240 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 241 TreeNode parentNode = scopeNodeTable[parentScope]; 242 if (parentNode.IsExpanded) { 243 parentNode.Nodes.Clear(); 244 foreach (IndexedItem<IScope> item in e.Items) 245 245 parentNode.Nodes.Insert(item.Index, scopeNodeTable[item.Value]); 246 246 } 247 247 } 248 248 } 249 private void SubScopes_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {250 if (InvokeRequired) 251 Invoke(new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_CollectionReset), sender, e);252 else { 253 Scope parentScope = subScopesScopeTable[(ScopeList)sender];249 private void SubScopes_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 250 if (InvokeRequired) 251 Invoke(new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_CollectionReset), sender, e); 252 else { 253 IScope parentScope = subScopesScopeTable[(ScopeList)sender]; 254 254 TreeNode parentNode = scopeNodeTable[parentScope]; 255 255 if (parentNode.IsExpanded) { … … 257 257 RemoveTreeNode(node); 258 258 parentNode.Nodes.Clear(); 259 foreach (IndexedItem< Scope> item in e.Items) {259 foreach (IndexedItem<IScope> item in e.Items) { 260 260 TreeNode node = CreateTreeNode(item.Value); 261 261 parentNode.Nodes.Insert(item.Index, node); -
trunk/sources/HeuristicLab.Core.Views/3.3/VariableCollectionView.cs
r2655 r2687 12 12 namespace HeuristicLab.Core.Views { 13 13 [Content(typeof(VariableCollection), true)] 14 [Content(typeof(IObservableKeyedCollection<string, Variable>), true)]15 public partial class VariableCollectionView : NamedItemCollectionView< Variable> {14 [Content(typeof(IObservableKeyedCollection<string, IVariable>), true)] 15 public partial class VariableCollectionView : NamedItemCollectionView<IVariable> { 16 16 /// <summary> 17 17 /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View". … … 28 28 /// <remarks>Calls <see cref="VariablesScopeView()"/>.</remarks> 29 29 /// <param name="scope">The scope whose variables should be represented visually.</param> 30 public VariableCollectionView(IObservableKeyedCollection<string, Variable> variableCollection)30 public VariableCollectionView(IObservableKeyedCollection<string, IVariable> variableCollection) 31 31 : this() { 32 32 NamedItemCollection = variableCollection; 33 33 } 34 35 protected override IVariable CreateItem() { 36 IVariable item = new Variable(); 37 item.Name = GetUniqueName(item.Name); 38 return item; 39 } 34 40 } 35 41 } -
trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs
r2676 r2687 65 65 66 66 /// <summary> 67 /// Removes the eventhandlers from the underlying <see cref=" IVariable"/>.67 /// Removes the eventhandlers from the underlying <see cref="Variable"/>. 68 68 /// </summary> 69 69 /// <remarks>Calls <see cref="ViewBase.RemoveItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> … … 74 74 75 75 /// <summary> 76 /// Adds eventhandlers to the underlying <see cref=" IVariable"/>.76 /// Adds eventhandlers to the underlying <see cref="Variable"/>. 77 77 /// </summary> 78 78 /// <remarks>Calls <see cref="ViewBase.AddItemEvents"/> of base class <see cref="ViewBase"/>.</remarks> -
trunk/sources/HeuristicLab.Core.Views/3.3/ViewHost.Designer.cs
r2676 r2687 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.viewPanel = new System.Windows.Forms.Panel(); 48 49 this.messageLabel = new System.Windows.Forms.Label(); 49 this.view Label = new System.Windows.Forms.Label();50 this. viewComboBox = new System.Windows.Forms.ComboBox();50 this.viewsLabel = new System.Windows.Forms.Label(); 51 this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); 51 52 this.SuspendLayout(); 52 53 // … … 56 57 | System.Windows.Forms.AnchorStyles.Left) 57 58 | System.Windows.Forms.AnchorStyles.Right))); 58 this.viewPanel.Location = new System.Drawing.Point(0, 27);59 this.viewPanel.Location = new System.Drawing.Point(0, 0); 59 60 this.viewPanel.Name = "viewPanel"; 60 this.viewPanel.Size = new System.Drawing.Size(2 27, 157);61 this.viewPanel.Size = new System.Drawing.Size(205, 184); 61 62 this.viewPanel.TabIndex = 2; 62 63 // … … 71 72 this.messageLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 72 73 // 73 // view Label74 // viewsLabel 74 75 // 75 this.viewLabel.AutoSize = true; 76 this.viewLabel.Location = new System.Drawing.Point(3, 3); 77 this.viewLabel.Name = "viewLabel"; 78 this.viewLabel.Size = new System.Drawing.Size(33, 13); 79 this.viewLabel.TabIndex = 0; 80 this.viewLabel.Text = "&View:"; 76 this.viewsLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 77 this.viewsLabel.ContextMenuStrip = this.contextMenuStrip; 78 this.viewsLabel.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Windows; 79 this.viewsLabel.Location = new System.Drawing.Point(211, 0); 80 this.viewsLabel.Name = "viewsLabel"; 81 this.viewsLabel.Size = new System.Drawing.Size(16, 16); 82 this.viewsLabel.TabIndex = 0; 81 83 // 82 // viewComboBox84 // contextMenuStrip 83 85 // 84 this.viewComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 85 | System.Windows.Forms.AnchorStyles.Right))); 86 this.viewComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 87 this.viewComboBox.FormattingEnabled = true; 88 this.viewComboBox.Location = new System.Drawing.Point(42, 0); 89 this.viewComboBox.Name = "viewComboBox"; 90 this.viewComboBox.Size = new System.Drawing.Size(185, 21); 91 this.viewComboBox.TabIndex = 1; 92 this.viewComboBox.SelectedIndexChanged += new System.EventHandler(this.viewComboBox_SelectedIndexChanged); 86 this.contextMenuStrip.Name = "contextMenuStrip"; 87 this.contextMenuStrip.ShowCheckMargin = true; 88 this.contextMenuStrip.ShowImageMargin = false; 89 this.contextMenuStrip.Size = new System.Drawing.Size(61, 4); 90 this.contextMenuStrip.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip_ItemClicked); 93 91 // 94 92 // ViewHost … … 96 94 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 97 95 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 98 this.Controls.Add(this.viewComboBox);99 this.Controls.Add(this.viewLabel);100 96 this.Controls.Add(this.viewPanel); 97 this.Controls.Add(this.viewsLabel); 101 98 this.Controls.Add(this.messageLabel); 102 99 this.Name = "ViewHost"; 103 100 this.Size = new System.Drawing.Size(227, 184); 104 101 this.ResumeLayout(false); 105 this.PerformLayout();106 102 107 103 } … … 110 106 111 107 protected System.Windows.Forms.Panel viewPanel; 112 protected System.Windows.Forms.Label viewLabel; 113 protected System.Windows.Forms.ComboBox viewComboBox; 108 protected System.Windows.Forms.Label viewsLabel; 114 109 protected System.Windows.Forms.Label messageLabel; 110 protected System.Windows.Forms.ContextMenuStrip contextMenuStrip; 115 111 116 112 } -
trunk/sources/HeuristicLab.Core.Views/3.3/ViewHost.cs
r2684 r2687 32 32 namespace HeuristicLab.Core.Views { 33 33 public partial class ViewHost : UserControl { 34 private Dictionary<Type, ToolStripMenuItem> typeMenuItemTable; 35 34 36 private object obj; 35 37 public object Object { … … 44 46 45 47 public ViewHost() { 48 typeMenuItemTable = new Dictionary<Type, ToolStripMenuItem>(); 46 49 InitializeComponent(); 47 50 Initialize(); … … 49 52 50 53 protected virtual void Initialize() { 51 viewLabel.Visible = false; 52 viewComboBox.Items.Clear(); 53 viewComboBox.Enabled = false; 54 viewComboBox.Visible = false; 54 viewsLabel.Enabled = false; 55 viewsLabel.Visible = false; 56 typeMenuItemTable.Clear(); 57 contextMenuStrip.Items.Clear(); 58 contextMenuStrip.Enabled = false; 55 59 messageLabel.Visible = false; 56 60 if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose(); … … 63 67 orderby t.Name ascending 64 68 select t; 65 foreach (Type viewType in viewTypes) 66 viewComboBox.Items.Add(viewType); 67 if (viewComboBox.Items.Count == 0) { 69 foreach (Type viewType in viewTypes) { 70 ToolStripMenuItem item = new ToolStripMenuItem(viewType.Name); 71 item.Name = viewType.FullName; 72 item.ToolTipText = viewType.FullName; 73 item.Tag = viewType; 74 contextMenuStrip.Items.Add(item); 75 typeMenuItemTable.Add(viewType, item); 76 } 77 if (contextMenuStrip.Items.Count == 0) { 68 78 messageLabel.Visible = true; 69 79 } else { 70 view Label.Visible= true;71 view ComboBox.Enabled= true;72 viewComboBox.Visible= true;80 viewsLabel.Enabled = true; 81 viewsLabel.Visible = true; 82 contextMenuStrip.Enabled = true; 73 83 messageLabel.Visible = false; 74 84 } … … 81 91 viewPanel.Enabled = true; 82 92 viewPanel.Visible = true; 83 viewComboBox.SelectedItem = view.GetType(); 93 typeMenuItemTable[view.GetType()].Checked = true; 94 typeMenuItemTable[view.GetType()].Enabled = false; 84 95 } 85 96 } 86 97 } 87 98 88 protected virtual void viewComboBox_SelectedIndexChanged(object sender, EventArgs e) { 89 if (viewComboBox.SelectedItem != viewPanel.Tag) { 90 if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose(); 91 viewPanel.Controls.Clear(); 92 Control view = (Control)MainFormManager.CreateView((Type)viewComboBox.SelectedItem, Object); 93 viewPanel.Controls.Add(view); 94 viewPanel.Tag = view; 95 view.Dock = DockStyle.Fill; 99 protected void contextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { 100 Type viewType = (Type)e.ClickedItem.Tag; 101 foreach (ToolStripMenuItem item in typeMenuItemTable.Values) { 102 item.Checked = false; 103 item.Enabled = true; 96 104 } 105 typeMenuItemTable[viewType].Checked = true; 106 typeMenuItemTable[viewType].Enabled = false; 107 108 if (viewPanel.Controls.Count > 0) viewPanel.Controls[0].Dispose(); 109 viewPanel.Controls.Clear(); 110 Control view = (Control)MainFormManager.CreateView(viewType, Object); 111 viewPanel.Controls.Add(view); 112 viewPanel.Tag = view; 113 view.Dock = DockStyle.Fill; 97 114 } 98 115 } -
trunk/sources/HeuristicLab.Core/3.3/Engine.cs
r2664 r2687 71 71 /// Gets the current global scope. 72 72 /// </summary> 73 public Scope GlobalScope {73 public IScope GlobalScope { 74 74 get { return globalScope; } 75 75 } … … 167 167 canceled = false; 168 168 running = false; 169 GlobalScope.Clear();169 globalScope.Clear(); 170 170 ExecutionTime = new TimeSpan(); 171 171 executionStack.Clear(); -
trunk/sources/HeuristicLab.Core/3.3/ExecutionContext.cs
r2664 r2687 40 40 41 41 [Storable] 42 private Scope scope;43 public Scope Scope {42 private IScope scope; 43 public IScope Scope { 44 44 get { return scope; } 45 45 } … … 50 50 scope = null; 51 51 } 52 public ExecutionContext(ExecutionContext parent, IOperator op, Scope scope) {52 public ExecutionContext(ExecutionContext parent, IOperator op, IScope scope) { 53 53 if ((op == null) || (scope == null)) throw new ArgumentNullException(); 54 54 this.parent = parent; … … 62 62 clone.parent = (ExecutionContext)cloner.Clone(parent); 63 63 clone.op = (IOperator)cloner.Clone(op); 64 clone.scope = ( Scope)cloner.Clone(scope);64 clone.scope = (IScope)cloner.Clone(scope); 65 65 return clone; 66 66 } -
trunk/sources/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj
r2664 r2687 106 106 <Compile Include="Engine.cs" /> 107 107 <Compile Include="Interfaces\IOperatorParameter.cs" /> 108 <Compile Include="Interfaces\IScope.cs" /> 109 <Compile Include="Interfaces\IVariable.cs" /> 108 110 <Compile Include="Item.cs" /> 109 111 <Compile Include="ItemParameter.cs" /> -
trunk/sources/HeuristicLab.Core/3.3/Interfaces/IEngine.cs
r2653 r2687 39 39 /// Gets the global scope of the current instance. 40 40 /// </summary> 41 Scope GlobalScope { get; }41 IScope GlobalScope { get; } 42 42 43 43 /// <summary> -
trunk/sources/HeuristicLab.Core/3.3/Interfaces/IParameter.cs
r2684 r2687 31 31 32 32 IItem GetValue(ExecutionContext context); 33 IItem GetValue(ExecutionContext context, bool throwOnError);34 33 } 35 34 } -
trunk/sources/HeuristicLab.Core/3.3/ItemCollection.cs
r2684 r2687 87 87 foreach (T item in items) 88 88 if (item != null) item.Changed += new ChangedEventHandler(Item_Changed); 89 IEnumerable<IEngine> i = (IEnumerable<IEngine>)items;90 89 base.OnItemsAdded(items); 91 90 } -
trunk/sources/HeuristicLab.Core/3.3/ItemParameter.cs
r2685 r2687 84 84 85 85 public override IItem GetValue(ExecutionContext context) { 86 return GetValue(context, true); 87 } 88 public override IItem GetValue(ExecutionContext context, bool throwOnError) { 89 if (Value != null) return Value; 90 91 ExecutionContext current, child; 92 IParameter parameter = null; 93 child = context; 94 current = context.Parent; 95 while ((current != null) && (parameter == null)) { 96 current.Operator.Parameters.TryGetValue(ActualName, out parameter); 97 child = current; 86 ItemParameter param = this; 87 ExecutionContext current = context; 88 string actualName = null; 89 while (param != null) { 90 if (param.Value != null) return param.Value; 91 actualName = param.ActualName; 98 92 current = current.Parent; 93 while ((current != null) && !current.Operator.Parameters.ContainsKey(actualName)) 94 current = current.Parent; 95 if (current != null) 96 param = (ItemParameter)current.Operator.Parameters[actualName]; 97 else 98 param = null; 99 99 } 100 100 101 if (parameter != null) return parameter.GetValue(child, throwOnError); 102 else { 103 Variable variable = context.Scope.Lookup(ActualName, true, throwOnError); 104 return variable == null ? null : variable.Value; 105 } 101 IScope scope = context.Scope; 102 while ((scope != null) && !scope.Variables.ContainsKey(actualName)) 103 scope = scope.Parent; 104 return scope != null ? scope.Variables[actualName].Value : null; 106 105 } 107 106 … … 157 156 158 157 public new T GetValue(ExecutionContext context) { 159 return GetValue(context, true); 160 } 161 public new T GetValue(ExecutionContext context, bool throwOnError) { 162 return (T)base.GetValue(context, throwOnError); 158 return (T)base.GetValue(context); 163 159 } 164 160 } -
trunk/sources/HeuristicLab.Core/3.3/Parameter.cs
r2684 r2687 57 57 58 58 public abstract IItem GetValue(ExecutionContext context); 59 public abstract IItem GetValue(ExecutionContext context, bool throwOnError);60 59 61 60 public override IDeepCloneable Clone(Cloner cloner) { -
trunk/sources/HeuristicLab.Core/3.3/Scope.cs
r2664 r2687 33 33 [Item("Scope", "A scope which contains variables and sub-scopes.")] 34 34 [Creatable("Test")] 35 public class Scope : NamedItem{35 public sealed class Scope : NamedItem, IScope { 36 36 [Storable] 37 private Scope parent; 37 private IScope parent; 38 public IScope Parent { 39 get { return parent; } 40 set { 41 if (parent != null) parent.SubScopes.Remove(this); 42 parent = value; 43 if ((parent != null) && !parent.SubScopes.Contains(this)) parent.SubScopes.Add(this); 44 } 45 } 38 46 39 47 private VariableCollection variables; … … 79 87 } 80 88 81 public Variable Lookup(string name, bool recursive) {82 return Lookup(name, recursive, true);83 }84 public Variable Lookup(string name, bool recursive, bool throwOnError) {85 Variable variable;86 87 if (this.variables.TryGetValue(name, out variable)) {88 return variable;89 } else if (recursive) {90 Scope scope = this.parent;91 while (scope != null) {92 if (scope.variables.TryGetValue(name, out variable))93 return variable;94 scope = scope.parent;95 }96 }97 if (throwOnError)98 throw new ArgumentException("Variable " + name + " not found");99 else100 return null;101 }102 103 89 /// <inheritdoc/> 104 90 public void Clear() { … … 109 95 /// <inheritdoc/> 110 96 public override IDeepCloneable Clone(Cloner cloner) { 111 Scope clone = (Scope)base.Clone(cloner); 112 clone.parent = (Scope)cloner.Clone(parent); 97 Scope clone = new Scope(); 98 cloner.RegisterClonedObject(this, clone); 99 clone.name = name; 100 clone.description = description; 101 clone.parent = (IScope)cloner.Clone(parent); 113 102 clone.Variables = (VariableCollection)cloner.Clone(variables); 114 103 clone.SubScopes = (ScopeList)cloner.Clone(subScopes); … … 119 108 private void RegisterSubScopesEvents() { 120 109 if (subScopes != null) { 121 subScopes.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsAdded);122 subScopes.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsRemoved);123 subScopes.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsReplaced);124 subScopes.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_CollectionReset);110 subScopes.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsAdded); 111 subScopes.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsRemoved); 112 subScopes.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsReplaced); 113 subScopes.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_CollectionReset); 125 114 subScopes.Changed += new ChangedEventHandler(SubScopes_Changed); 126 115 } … … 128 117 private void DeregisterSubScopesEvents() { 129 118 if (subScopes != null) { 130 subScopes.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsAdded);131 subScopes.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsRemoved);132 subScopes.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_ItemsReplaced);133 subScopes.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem< Scope>>(SubScopes_CollectionReset);119 subScopes.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsAdded); 120 subScopes.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsRemoved); 121 subScopes.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_ItemsReplaced); 122 subScopes.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<IScope>>(SubScopes_CollectionReset); 134 123 subScopes.Changed -= new ChangedEventHandler(SubScopes_Changed); 135 124 } 136 125 } 137 private void SubScopes_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {138 foreach (IndexedItem< Scope> item in e.Items)139 item.Value. parent = this;126 private void SubScopes_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 127 foreach (IndexedItem<IScope> item in e.Items) 128 item.Value.Parent = this; 140 129 } 141 private void SubScopes_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {142 foreach (IndexedItem< Scope> item in e.Items)143 item.Value. parent = null;130 private void SubScopes_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 131 foreach (IndexedItem<IScope> item in e.Items) 132 item.Value.Parent = null; 144 133 } 145 private void SubScopes_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {146 foreach (IndexedItem< Scope> oldItem in e.OldItems)147 oldItem.Value. parent = null;148 foreach (IndexedItem< Scope> item in e.Items)149 item.Value. parent = this;134 private void SubScopes_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 135 foreach (IndexedItem<IScope> oldItem in e.OldItems) 136 oldItem.Value.Parent = null; 137 foreach (IndexedItem<IScope> item in e.Items) 138 item.Value.Parent = this; 150 139 } 151 private void SubScopes_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem< Scope>> e) {152 foreach (IndexedItem< Scope> oldItem in e.OldItems)153 oldItem.Value. parent = null;154 foreach (IndexedItem< Scope> item in e.Items)155 item.Value. parent = this;140 private void SubScopes_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<IScope>> e) { 141 foreach (IndexedItem<IScope> oldItem in e.OldItems) 142 oldItem.Value.Parent = null; 143 foreach (IndexedItem<IScope> item in e.Items) 144 item.Value.Parent = this; 156 145 } 157 146 private void SubScopes_Changed(object sender, ChangedEventArgs e) { -
trunk/sources/HeuristicLab.Core/3.3/ScopeList.cs
r2653 r2687 34 34 [Item("ScopeList", "Represents a list of scopes.")] 35 35 [Creatable("Test")] 36 public class ScopeList : ItemList< Scope> {36 public class ScopeList : ItemList<IScope> { 37 37 public ScopeList() : base() { } 38 38 public ScopeList(int capacity) : base(capacity) { } 39 public ScopeList(IEnumerable< Scope> collection) : base(collection) { }39 public ScopeList(IEnumerable<IScope> collection) : base(collection) { } 40 40 } 41 41 } -
trunk/sources/HeuristicLab.Core/3.3/Variable.cs
r2664 r2687 33 33 [Item("Variable", "A variable which has a name and holds an IItem.")] 34 34 [Creatable("Test")] 35 public sealed class Variable : NamedItem {35 public sealed class Variable : NamedItem, IVariable { 36 36 private IItem value; 37 37 /// <inheritdoc/> … … 67 67 : base(name) { 68 68 Value = value; 69 }70 71 /// <inheritdoc cref="IVariable.GetValue<T>"/>72 public T GetValue<T>() where T : class, IItem {73 return (T)Value;74 69 } 75 70 -
trunk/sources/HeuristicLab.Core/3.3/VariableCollection.cs
r2653 r2687 33 33 [Item("VariableCollection", "Represents a collection of variables.")] 34 34 [Creatable("Test")] 35 public class VariableCollection : NamedItemCollection< Variable>, IItem {35 public class VariableCollection : NamedItemCollection<IVariable>, IItem { 36 36 public virtual string ItemName { 37 37 get { return ItemAttribute.GetName(this.GetType()); } … … 46 46 public VariableCollection() : base() { } 47 47 public VariableCollection(int capacity) : base(capacity) { } 48 public VariableCollection(IEnumerable< Variable> collection) : base(collection) { }48 public VariableCollection(IEnumerable<IVariable> collection) : base(collection) { } 49 49 50 50 public override string ToString() { -
trunk/sources/HeuristicLab.Operators/3.3/StandardOperator.cs
r2684 r2687 45 45 46 46 public override ExecutionContextCollection Apply(ExecutionContext context) { 47 IOperator successor = Successor.GetValue(context , false);47 IOperator successor = Successor.GetValue(context); 48 48 if (successor != null) 49 49 return new ExecutionContextCollection(new ExecutionContext(context.Parent, successor, context.Scope));
Note: See TracChangeset
for help on using the changeset viewer.