From 18177903cfb30d203427a8dfb7949cd5f77628c8 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 6 May 2010 12:49:36 +0000 Subject: [PATCH] XamlOutlineContentHost: update outline view only if parse info of the correct file was updated (previously was updating whenever there was any new parse info) git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5765 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../XamlBinding/XamlOutlineContentHost.xaml.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs index d0b57e2b5d..4d8e828018 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs @@ -9,7 +9,7 @@ using System; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Threading; - +using ICSharpCode.Core; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Editor; @@ -33,19 +33,14 @@ namespace ICSharpCode.XamlBinding ParserService.ParseInformationUpdated += ParseInfoUpdated; } - void ParseInfoUpdated(object sender, EventArgs e) + void ParseInfoUpdated(object sender, ParseInformationEventArgs e) { - if (this.editor == null || string.IsNullOrEmpty(this.editor.FileName)) - return; - - ParseInformation info = ParserService.GetExistingParseInformation(this.editor.FileName); - - if (info == null || !(info.CompilationUnit is XamlCompilationUnit)) + if (this.editor == null || !FileUtility.IsEqualFileName(this.editor.FileName, e.FileName)) return; - var cu = info.CompilationUnit as XamlCompilationUnit; + var cu = e.NewCompilationUnit as XamlCompilationUnit; - if (cu.TreeRootNode != null) + if (cu != null && cu.TreeRootNode != null) UpdateTree(cu.TreeRootNode); }