- Timestamp:
- 11/12/09 17:40:12 (15 years ago)
- Location:
- branches/PluginInfrastructure Refactoring/HeuristicLab.Core
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/PluginInfrastructure Refactoring/HeuristicLab.Core/3.2/ChooseItemDialog.cs
r1529 r2484 89 89 } 90 90 91 DiscoveryService discoveryService = new DiscoveryService(); 92 foreach ( PluginInfo plugin in discoveryService.Plugins) {91 92 foreach (var plugin in ApplicationManager.Manager.Plugins) { 93 93 TreeNode pluginNode = new TreeNode(plugin.Name); 94 94 pluginNode.Tag = null; 95 95 96 Type[] types = discoveryService.GetTypes(itemType, plugin); 97 foreach (Type type in types) { 96 foreach (Type type in ApplicationManager.Manager.GetTypes(itemType, plugin)) { 98 97 if (!type.IsAbstract) { 99 98 TreeNode itemNode = new TreeNode(); -
branches/PluginInfrastructure Refactoring/HeuristicLab.Core/3.2/ChooseOperatorDialog.cs
r1529 r2484 70 70 builtinOperatorsTreeView.TreeViewNodeSorter = nodeSorter; 71 71 72 DiscoveryService discoveryService = new DiscoveryService(); 73 PluginInfo[] plugins = discoveryService.Plugins; 74 foreach(PluginInfo plugin in plugins) { 72 foreach (var pluginDescription in ApplicationManager.Manager.Plugins) { 75 73 TreeNode pluginItem = new TreeNode(); 76 pluginItem.Text = plugin .Name;77 pluginItem.Tag = plugin ;74 pluginItem.Text = pluginDescription.Name; 75 pluginItem.Tag = pluginDescription; 78 76 79 Type[] operators = discoveryService.GetTypes(typeof(IOperator), plugin); 80 foreach(Type type in operators) { 81 if(!type.IsAbstract) { 77 foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(IOperator), pluginDescription)) { 78 if (!type.IsAbstract) { 82 79 TreeNode operatorItem = new TreeNode(); 83 80 operatorItem.Text = type.Name; … … 87 84 } 88 85 // add plugin node only if it contains operators 89 if (pluginItem.Nodes.Count > 0) {86 if (pluginItem.Nodes.Count > 0) { 90 87 builtinOperatorsTreeView.Nodes.Add(pluginItem); 91 88 } -
branches/PluginInfrastructure Refactoring/HeuristicLab.Core/3.2/ChooseTypeDialog.cs
r1529 r2484 90 90 } 91 91 92 DiscoveryService discoveryService = new DiscoveryService(); 93 foreach (PluginInfo plugin in discoveryService.Plugins) { 92 foreach (var plugin in ApplicationManager.Manager.Plugins) { 94 93 TreeNode pluginNode = new TreeNode(plugin.Name); 95 94 pluginNode.Tag = null; 96 95 97 Type[] types = discoveryService.GetTypes(baseType, plugin); 98 foreach (Type type in types) { 96 foreach (Type type in ApplicationManager.Manager.GetTypes(baseType, plugin)) { 99 97 TreeNode itemNode = new TreeNode(); 100 98 itemNode.Text = type.Name; -
branches/PluginInfrastructure Refactoring/HeuristicLab.Core/3.2/HeuristicLabCorePlugin.cs
r1529 r2484 30 30 /// Plugin class for HeuristicLab.Core plugin. 31 31 /// </summary> 32 [ ClassInfo(Name ="HeuristicLab.Core-3.2")]33 [PluginFile( Filename = "HeuristicLab.Core-3.2.dll", Filetype =PluginFileType.Assembly)]32 [Plugin("HeuristicLab.Core-3.2")] 33 [PluginFile("HeuristicLab.Core-3.2.dll", PluginFileType.Assembly)] 34 34 public class HeuristicLabCorePlugin : PluginBase { 35 35 } -
branches/PluginInfrastructure Refactoring/HeuristicLab.Core/3.2/OperatorGraphView.cs
r1529 r2484 183 183 IView view = op.CreateView(); 184 184 if (view != null) 185 PluginManager.ControlManager.ShowControl(view);185 ControlManager.Manager.ShowControl(view); 186 186 } 187 187 } … … 410 410 private void viewToolStripMenuItem_Click(object sender, EventArgs e) { 411 411 IView view = (IView)((ToolStripMenuItem)sender).Tag; 412 PluginManager.ControlManager.ShowControl(view);412 ControlManager.Manager.ShowControl(view); 413 413 } 414 414 private void initialOperatorToolStripMenuItem_Click(object sender, EventArgs e) { -
branches/PluginInfrastructure Refactoring/HeuristicLab.Core/3.2/OperatorLibraryEditor.cs
r1529 r2484 148 148 149 149 private void MergeOperatorLibrary(IOperatorGroup src, IOperatorGroup dest) { 150 foreach (IOperator op in src.Operators) {151 if (!Contains(dest, op)) {150 foreach (IOperator op in src.Operators) { 151 if (!Contains(dest, op)) { 152 152 dest.AddOperator(op); 153 153 } 154 154 } 155 155 156 foreach (OperatorGroup group in src.SubGroups) {156 foreach (OperatorGroup group in src.SubGroups) { 157 157 bool mergedIntoExistingGroup = false; 158 158 // try to find a group in dest with matching name 159 foreach (OperatorGroup destGroup in dest.SubGroups) {160 if (group.Name == destGroup.Name) {159 foreach (OperatorGroup destGroup in dest.SubGroups) { 160 if (group.Name == destGroup.Name) { 161 161 MergeOperatorLibrary(group, destGroup); 162 162 mergedIntoExistingGroup = true; … … 164 164 } 165 165 } 166 if (!mergedIntoExistingGroup) {166 if (!mergedIntoExistingGroup) { 167 167 OperatorGroup newGroup = new OperatorGroup(); 168 168 newGroup.Name = group.Name; … … 174 174 175 175 private bool Contains(IOperatorGroup group, IOperator op) { 176 foreach (IOperator destOp in group.Operators) {177 if (op.Name == destOp.Name) {176 foreach (IOperator destOp in group.Operators) { 177 if (op.Name == destOp.Name) { 178 178 return true; 179 179 } … … 204 204 IView view = op.CreateView(); 205 205 if (view != null) 206 PluginManager.ControlManager.ShowControl(view);206 ControlManager.Manager.ShowControl(view); 207 207 } 208 208 } … … 236 236 } 237 237 private void importButton_Click(object sender, EventArgs e) { 238 if (openFileDialog.ShowDialog() == DialogResult.OK) {238 if (openFileDialog.ShowDialog() == DialogResult.OK) { 239 239 IOperatorLibrary loadedLibrary = (PersistenceManager.Load(openFileDialog.FileName) as IOperatorLibrary); 240 if (loadedLibrary == null) {240 if (loadedLibrary == null) { 241 241 Auxiliary.ShowErrorMessageBox("The selected file does not contain an operator library"); 242 242 } else { … … 287 287 private void viewToolStripMenuItem_Click(object sender, EventArgs e) { 288 288 IView view = (IView)viewToolStripMenuItem.Tag; 289 PluginManager.ControlManager.ShowControl(view);289 ControlManager.Manager.ShowControl(view); 290 290 } 291 291 #endregion -
branches/PluginInfrastructure Refactoring/HeuristicLab.Core/3.2/ScopeView.cs
r1529 r2484 128 128 private void scopesTreeView_DoubleClick(object sender, EventArgs e) { 129 129 // make sure that we can't get NullPointerExceptions 130 if (scopesTreeView.SelectedNode != null && scopesTreeView.SelectedNode.Tag != null) {130 if (scopesTreeView.SelectedNode != null && scopesTreeView.SelectedNode.Tag != null) { 131 131 IScope scope = (IScope)scopesTreeView.SelectedNode.Tag; 132 PluginManager.ControlManager.ShowControl(new VariablesScopeView(scope));132 ControlManager.Manager.ShowControl(new VariablesScopeView(scope)); 133 133 } 134 134 } … … 198 198 private void variablesToolStripMenuItem_Click(object sender, EventArgs e) { 199 199 IScope scope = (IScope)scopesTreeView.SelectedNode.Tag; 200 PluginManager.ControlManager.ShowControl(new VariablesScopeView(scope));200 ControlManager.Manager.ShowControl(new VariablesScopeView(scope)); 201 201 } 202 202 private void showViewToolStripMenuItem_Click(object sender, EventArgs e) { 203 203 IItem item = (IItem)((ToolStripMenuItem)sender).Tag; 204 PluginManager.ControlManager.ShowControl(item.CreateView());204 ControlManager.Manager.ShowControl(item.CreateView()); 205 205 } 206 206 #endregion
Note: See TracChangeset
for help on using the changeset viewer.