Changeset 4840 for branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionView.cs
- Timestamp:
- 11/18/10 18:50:16 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionView.cs
r4803 r4840 23 23 using HeuristicLab.MainForm; 24 24 using HeuristicLab.MainForm.WindowsForms; 25 using HeuristicLab.PluginInfrastructure; 26 using System.Collections.Generic; 25 27 26 28 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views { … … 28 30 [Content(typeof(SymbolicExpressionTree), false)] 29 31 public partial class SymbolicExpressionView : AsynchronousContentView { 30 private SymbolicExpressionTreeStringFormatter treeFormatter; 32 private ISymbolicExpressionTreeStringFormatter treeFormatter; 33 List<ISymbolicExpressionTreeStringFormatter> treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>(); 31 34 32 35 public new SymbolicExpressionTree Content { … … 37 40 public SymbolicExpressionView() { 38 41 InitializeComponent(); 39 treeFormatter = new SymbolicExpressionTreeStringFormatter(); 42 IEnumerator<ISymbolicExpressionTreeStringFormatter> formatters = ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeStringFormatter>().GetEnumerator(); 43 treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>(); 44 formatters.MoveNext(); 45 int selectedIndex = -1; 46 while (formatters.Current != null) { 47 if (formatters.Current is SymbolicExpressionTreeStringFormatter) 48 selectedIndex = treeFormattersList.Count; 49 treeFormattersList.Add(formatters.Current.Clone() as ISymbolicExpressionTreeStringFormatter); 50 formattersComboBox.Items.Add(treeFormattersList[treeFormattersList.Count - 1].Name); 51 formatters.MoveNext(); 52 } 53 formattersComboBox.SelectedIndex = selectedIndex; 54 //treeFormatter = new SymbolicExpressionTreeStringFormatter(); 40 55 } 41 56 … … 53 68 textBox.ReadOnly = ReadOnly; 54 69 } 70 71 private void formattersComboBox_SelectedIndexChanged(object sender, System.EventArgs e) { 72 treeFormatter = treeFormattersList[formattersComboBox.SelectedIndex]; 73 OnContentChanged(); 74 } 55 75 } 56 76 }
Note: See TracChangeset
for help on using the changeset viewer.