From 24507c638c047a216b9d86cdbe958e27dcceb118 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 15 Aug 2008 17:34:14 +0000 Subject: [PATCH] Converted GoTo dialog to WPF, add LocalizeExtension to ICSharpCode.Core.Presentation. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0wpf@3373 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Configuration/AssemblyInfo.cs | 10 +- .../Project/ICSharpCode.SharpDevelop.csproj | 7 +- .../Base/Project/Resources/GotoDialog.xfrm | 70 -------- .../Project/Src/Commands/AutostartCommands.cs | 2 +- src/Main/Base/Project/Src/Gui/App.xaml | 19 +++ src/Main/Base/Project/Src/Gui/App.xaml.cs | 16 ++ .../Src/Gui/Workbench/WpfWorkbench.xaml | 10 -- .../ClassBrowserIconService.cs | 158 +++++++++--------- .../Src/TextEditor/Gui/Dialogs/GotoDialog.cs | 106 ++++++------ .../TextEditor/Gui/Dialogs/GotoDialog.xaml | 68 ++++++++ .../ICSharpCode.Core.Presentation.csproj | 1 + .../LocalizeExtension.cs | 30 ++++ .../Properties/AssemblyInfo.cs | 4 + 13 files changed, 283 insertions(+), 218 deletions(-) delete mode 100644 src/Main/Base/Project/Resources/GotoDialog.xfrm create mode 100644 src/Main/Base/Project/Src/Gui/App.xaml create mode 100644 src/Main/Base/Project/Src/Gui/App.xaml.cs create mode 100644 src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.xaml create mode 100644 src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Configuration/AssemblyInfo.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Configuration/AssemblyInfo.cs index ac57010a8d..e4bd7bac8e 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Configuration/AssemblyInfo.cs @@ -41,10 +41,10 @@ using System.Windows.Markup; // app, or any theme specific resource dictionaries) )] -[assembly: XmlnsPrefix("http://sharpdevelop.net", "sd")] +[assembly: XmlnsPrefix("http://icsharpcode.net/sharpdevelop/wpfdesigner", "wpfdesigner")] -[assembly: XmlnsDefinition("http://sharpdevelop.net", "ICSharpCode.WpfDesign.Designer")] -[assembly: XmlnsDefinition("http://sharpdevelop.net", "ICSharpCode.WpfDesign.Designer.Controls")] -[assembly: XmlnsDefinition("http://sharpdevelop.net", "ICSharpCode.WpfDesign.Designer.PropertyGrid")] -[assembly: XmlnsDefinition("http://sharpdevelop.net", "ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors")] +[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/wpfdesigner", "ICSharpCode.WpfDesign.Designer")] +[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/wpfdesigner", "ICSharpCode.WpfDesign.Designer.Controls")] +[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/wpfdesigner", "ICSharpCode.WpfDesign.Designer.PropertyGrid")] +[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/wpfdesigner", "ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors")] diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj index 25fdee8c8a..d36cf5e65f 100644 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj @@ -70,6 +70,10 @@ + + App.xaml + Code + @@ -477,7 +481,6 @@ - @@ -796,7 +799,9 @@ ICSharpCode.SharpDevelop.Widgets True + + \ No newline at end of file diff --git a/src/Main/Base/Project/Resources/GotoDialog.xfrm b/src/Main/Base/Project/Resources/GotoDialog.xfrm deleted file mode 100644 index b4fa3b3220..0000000000 --- a/src/Main/Base/Project/Resources/GotoDialog.xfrm +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Main/Base/Project/Src/Commands/AutostartCommands.cs b/src/Main/Base/Project/Src/Commands/AutostartCommands.cs index d2194ea554..142e4af11f 100644 --- a/src/Main/Base/Project/Src/Commands/AutostartCommands.cs +++ b/src/Main/Base/Project/Src/Commands/AutostartCommands.cs @@ -125,7 +125,7 @@ namespace ICSharpCode.SharpDevelop.Commands // finally run the workbench window ... //Application.AddMessageFilter(new FormKeyHandler()); //Application.Run(WorkbenchSingleton.MainForm); - var application = new System.Windows.Application(); + App application = new App(); System.Windows.Forms.Integration.WindowsFormsHost.EnableWindowsFormsInterop(); application.Run(WorkbenchSingleton.MainWindow); diff --git a/src/Main/Base/Project/Src/Gui/App.xaml b/src/Main/Base/Project/Src/Gui/App.xaml new file mode 100644 index 0000000000..b7aa08ec5e --- /dev/null +++ b/src/Main/Base/Project/Src/Gui/App.xaml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/src/Main/Base/Project/Src/Gui/App.xaml.cs b/src/Main/Base/Project/Src/Gui/App.xaml.cs new file mode 100644 index 0000000000..df05e26be4 --- /dev/null +++ b/src/Main/Base/Project/Src/Gui/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Windows; + +namespace ICSharpCode.SharpDevelop.Gui +{ + /// + /// Interaction logic for App.xaml + /// + partial class App : Application + { + public App() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.xaml b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.xaml index d5a96d8167..f066c4f1e4 100644 --- a/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.xaml +++ b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.xaml @@ -1,20 +1,10 @@ - - - diff --git a/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs b/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs index 672b3cd5ad..eff5f260de 100644 --- a/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs +++ b/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs @@ -6,6 +6,7 @@ // using System; +using System.Collections.Generic; using System.Reflection; using System.Windows.Forms; @@ -214,85 +215,92 @@ namespace ICSharpCode.SharpDevelop return BASE; } + public static readonly IList ResourceNames; + static ClassBrowserIconService() { imglist = new ImageList(); imglist.ColorDepth = ColorDepth.Depth32Bit; - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Assembly")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.OpenAssembly")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Library")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.NameSpace")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.SubTypes")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.SuperTypes")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ClosedFolderBitmap")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.OpenFolderBitmap")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Reference")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ClosedReferenceFolder")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.OpenReferenceFolder")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ResourceFileIcon")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Event")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.SelectionArrow")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.CombineIcon")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Literal")); // const - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Local")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Parameter")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.TextFileIcon")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Class")); //19 - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalClass")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedClass")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateClass")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Struct")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalStruct")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedStruct")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateStruct")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Interface")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalInterface")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedInterface")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateInterface")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Enum")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalEnum")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedEnum")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateEnum")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Method")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalMethod")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedMethod")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateMethod")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Property")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalProperty")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedProperty")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateProperty")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Field")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalField")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedField")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateField")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Delegate")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalDelegate")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedDelegate")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateDelegate")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Event")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalEvent")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedEvent")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateEvent")); - - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Indexer")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalIndexer")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedIndexer")); - imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateIndexer")); + ResourceNames = new List { + "Icons.16x16.Assembly", + "Icons.16x16.OpenAssembly", + + "Icons.16x16.Library", + "Icons.16x16.NameSpace", + "Icons.16x16.SubTypes", + "Icons.16x16.SuperTypes", + + "Icons.16x16.ClosedFolderBitmap", + "Icons.16x16.OpenFolderBitmap", + + "Icons.16x16.Reference", + "Icons.16x16.ClosedReferenceFolder", + "Icons.16x16.OpenReferenceFolder", + + "Icons.16x16.ResourceFileIcon", + "Icons.16x16.Event", + "Icons.16x16.SelectionArrow", + + "Icons.16x16.CombineIcon", + "Icons.16x16.Literal", // const + + "Icons.16x16.Local", + "Icons.16x16.Parameter", + "Icons.16x16.TextFileIcon", + + "Icons.16x16.Class", //19 + "Icons.16x16.InternalClass", + "Icons.16x16.ProtectedClass", + "Icons.16x16.PrivateClass", + + "Icons.16x16.Struct", + "Icons.16x16.InternalStruct", + "Icons.16x16.ProtectedStruct", + "Icons.16x16.PrivateStruct", + + "Icons.16x16.Interface", + "Icons.16x16.InternalInterface", + "Icons.16x16.ProtectedInterface", + "Icons.16x16.PrivateInterface", + + "Icons.16x16.Enum", + "Icons.16x16.InternalEnum", + "Icons.16x16.ProtectedEnum", + "Icons.16x16.PrivateEnum", + + "Icons.16x16.Method", + "Icons.16x16.InternalMethod", + "Icons.16x16.ProtectedMethod", + "Icons.16x16.PrivateMethod", + + "Icons.16x16.Property", + "Icons.16x16.InternalProperty", + "Icons.16x16.ProtectedProperty", + "Icons.16x16.PrivateProperty", + + "Icons.16x16.Field", + "Icons.16x16.InternalField", + "Icons.16x16.ProtectedField", + "Icons.16x16.PrivateField", + + "Icons.16x16.Delegate", + "Icons.16x16.InternalDelegate", + "Icons.16x16.ProtectedDelegate", + "Icons.16x16.PrivateDelegate", + + "Icons.16x16.Event", + "Icons.16x16.InternalEvent", + "Icons.16x16.ProtectedEvent", + "Icons.16x16.PrivateEvent", + + "Icons.16x16.Indexer", + "Icons.16x16.InternalIndexer", + "Icons.16x16.ProtectedIndexer", + "Icons.16x16.PrivateIndexer" + }.AsReadOnly(); + foreach (string r in ResourceNames) { + imglist.Images.Add(WinFormsResourceService.GetBitmap(r)); + } } } } diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs index ab104bc16f..4f4adb7e45 100644 --- a/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs +++ b/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs @@ -5,24 +5,26 @@ // $Revision$ // +using ICSharpCode.Core.Presentation; using System; using System.Collections; using System.Collections.Generic; using System.Drawing; using System.IO; -using System.Windows.Forms; - +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; using ICSharpCode.Core; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.SharpDevelop.Dom; -using ICSharpCode.SharpDevelop.Gui.XmlForms; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.TextEditor; using ICSharpCode.TextEditor.Gui.CompletionWindow; namespace ICSharpCode.SharpDevelop.Gui { - public class GotoDialog : BaseSharpDevelopForm + public partial class GotoDialog : Window { static GotoDialog Instance = null; @@ -30,64 +32,49 @@ namespace ICSharpCode.SharpDevelop.Gui { if (Instance == null) { Instance = new GotoDialog(); - Instance.Show(WorkbenchSingleton.MainWin32Window); + Instance.Owner = WorkbenchSingleton.MainWindow; + Instance.Show(); } else { - Instance.Focus(); + Instance.Activate(); } } - ListView listView; - TextBox textBox; - public GotoDialog() { - SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.GotoDialog.xfrm")); - ControlDictionary["okButton"].Click += new EventHandler(OKButtonClick); - ControlDictionary["cancelButton"].Click += new EventHandler(CancelButtonClick); - listView = (ListView)ControlDictionary["listView"]; - textBox = (TextBox)ControlDictionary["textBox"]; - textBox.TextChanged += TextBoxTextChanged; - textBox.KeyDown += TextBoxKeyDown; - listView.SmallImageList = ClassBrowserIconService.ImageList; - listView.ItemActivate += OKButtonClick; - listView.Sorting = SortOrder.Ascending; - listView.SizeChanged += ListViewSizeChanged; - listView.HideSelection = false; - ListViewSizeChanged(null, null); - Icon = null; - FormLocationHelper.Apply(this, "ICSharpCode.SharpDevelop.Gui.GotoDialog.Bounds", true); + InitializeComponent(); +// listView.SmallImageList = ClassBrowserIconService.ImageList; +// listView.ItemActivate += OKButtonClick; +// listView.Sorting = SortOrder.Ascending; +// listView.HideSelection = false; +// FormLocationHelper.Apply(this, "ICSharpCode.SharpDevelop.Gui.GotoDialog.Bounds", true); + textBox.Focus(); } - void ListViewSizeChanged(object sender, EventArgs e) + void textBoxPreviewKeyDown(object sender, KeyEventArgs e) { - listView.Columns[0].Width = listView.Width - 24; - } - - void TextBoxKeyDown(object sender, KeyEventArgs e) - { - if (listView.SelectedItems.Count == 0) + if (listBox.SelectedItem == null) return; - if (e.KeyData == Keys.Up) { + if (e.Key == Key.Up) { e.Handled = true; ChangeIndex(-1); - } else if (e.KeyData == Keys.Down) { + } else if (e.Key == Key.Down) { e.Handled = true; ChangeIndex(+1); - } else if (e.KeyData == Keys.PageUp) { + } else if (e.Key == Key.PageUp) { e.Handled = true; - ChangeIndex(-listView.ClientSize.Height / listView.Items[0].Bounds.Height); - } else if (e.KeyData == Keys.PageDown) { + ChangeIndex((int)Math.Round(-listBox.ActualHeight / ((ListBoxItem)listBox.SelectedItem).ActualHeight)); + } else if (e.Key == Key.PageDown) { e.Handled = true; - ChangeIndex(+listView.ClientSize.Height / listView.Items[0].Bounds.Height); + ChangeIndex((int)Math.Round(+listBox.ActualHeight / ((ListBoxItem)listBox.SelectedItem).ActualHeight)); } } void ChangeIndex(int increment) { - int index = listView.SelectedIndices[0]; - index = Math.Max(0, Math.Min(listView.Items.Count - 1, index + increment)); - listView.Items[index].Selected = true; - listView.EnsureVisible(index); + int index = listBox.SelectedIndex; + index = Math.Max(0, Math.Min(listBox.Items.Count - 1, index + increment)); + ((ListBoxItem)listBox.Items[index]).IsSelected = true; + listBox.ScrollIntoView(listBox.Items[index]); } ICompletionData[] ctrlSpaceCompletionData; @@ -126,21 +113,18 @@ namespace ICSharpCode.SharpDevelop.Gui Dictionary visibleEntries = new Dictionary(); int bestMatchType; double bestPriority; - ListViewItem bestItem; + ListBoxItem bestItem; - void TextBoxTextChanged(object sender, EventArgs e) + void textBoxTextChanged(object sender, TextChangedEventArgs e) { string text = textBox.Text.Trim(); - listView.BeginUpdate(); - listView.Items.Clear(); + listBox.Items.Clear(); visibleEntries.Clear(); bestItem = null; if (text.Length == 0) { - listView.EndUpdate(); return; } if (text.Length == 1 && !char.IsDigit(text, 0)) { - listView.EndUpdate(); return; } int dotPos = text.IndexOf('.'); @@ -190,10 +174,9 @@ namespace ICSharpCode.SharpDevelop.Gui ShowCtrlSpaceCompletion(text); } if (bestItem != null) { - bestItem.Selected = true; - listView.EnsureVisible(bestItem.Index); + bestItem.IsSelected = true; + listBox.ScrollIntoView(bestItem); } - listView.EndUpdate(); } void AddSourceFiles(string text, int lineNumber) @@ -335,7 +318,18 @@ namespace ICSharpCode.SharpDevelop.Gui if (visibleEntries.ContainsKey(text)) return; visibleEntries.Add(text, null); - ListViewItem item = new ListViewItem(text, imageIndex); + ListBoxItem item = new ListBoxItem(); + item.Content = new StackPanel { + Orientation = Orientation.Horizontal, + Children = { + PresentationResourceService.GetImage(ClassBrowserIconService.ResourceNames[imageIndex]), + new TextBlock { + Text = text, + Margin = new Thickness(4, 0, 0, 0) + } + } + }; + item.MouseDoubleClick += okButtonClick; item.Tag = tag; if (bestItem == null || (tag is IMember && bestItem.Tag is IClass) @@ -346,7 +340,7 @@ namespace ICSharpCode.SharpDevelop.Gui bestPriority = priority; bestMatchType = matchType; } - listView.Items.Add(item); + listBox.Items.Add(item); } void AddItem(IClass c, int matchType) @@ -368,7 +362,7 @@ namespace ICSharpCode.SharpDevelop.Gui AddItem(e.Name + " (" + e.FullyQualifiedName + ")", imageIndex, e, priority, matchType); } - void CancelButtonClick(object sender, EventArgs e) + void cancelButtonClick(object sender, RoutedEventArgs e) { Close(); } @@ -389,12 +383,12 @@ namespace ICSharpCode.SharpDevelop.Gui return null; } - void OKButtonClick(object sender, EventArgs e) + void okButtonClick(object sender, RoutedEventArgs e) { try { - if (listView.SelectedItems.Count == 0) + if (listBox.SelectedItem == null) return; - object tag = listView.SelectedItems[0].Tag; + object tag = ((ListBoxItem)listBox.SelectedItem).Tag; if (tag is int) { TextEditorControl editor = GetEditor(); if (editor != null) { diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.xaml b/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.xaml new file mode 100644 index 0000000000..527d7395b1 --- /dev/null +++ b/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.xaml @@ -0,0 +1,68 @@ + + + +