Changeset 4842
- Timestamp:
- 11/19/10 09:38:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.Extensions/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionView.cs
r4841 r4842 40 40 public SymbolicExpressionView() { 41 41 InitializeComponent(); 42 IEnumera tor<ISymbolicExpressionTreeStringFormatter> formatters = ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeStringFormatter>().GetEnumerator();42 IEnumerable<ISymbolicExpressionTreeStringFormatter> formatters = ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeStringFormatter>(); 43 43 treeFormattersList = new List<ISymbolicExpressionTreeStringFormatter>(); 44 formatters.MoveNext();45 44 int selectedIndex = -1; 46 while (formatters.Current != null) {47 if (formatter s.Currentis SymbolicExpressionTreeStringFormatter)45 foreach (ISymbolicExpressionTreeStringFormatter formatter in formatters) { 46 if (formatter is SymbolicExpressionTreeStringFormatter) 48 47 selectedIndex = treeFormattersList.Count; 49 ISymbolicExpressionTreeStringFormatter formatter = formatters.Current.Clone() as ISymbolicExpressionTreeStringFormatter;50 48 treeFormattersList.Add(formatter); 51 49 formattersComboBox.Items.Add(formatter.Name); 52 formatters.MoveNext();53 50 } 54 51 formattersComboBox.SelectedIndex = selectedIndex; … … 57 54 protected override void OnContentChanged() { 58 55 base.OnContentChanged(); 56 UpdateTextbox(); 57 } 58 59 private void UpdateTextbox() { 59 60 if (Content == null) 60 61 textBox.Text = string.Empty; … … 70 71 71 72 private void formattersComboBox_SelectedIndexChanged(object sender, System.EventArgs e) { 72 OnContentChanged();73 UpdateTextbox(); 73 74 } 74 75 }
Note: See TracChangeset
for help on using the changeset viewer.