Browse Source

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
pull/1/head
Daniel Grunwald 15 years ago
parent
commit
18177903cf
  1. 15
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs

15
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs

@ -9,7 +9,7 @@ using System;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Threading; using System.Windows.Threading;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
@ -33,19 +33,14 @@ namespace ICSharpCode.XamlBinding
ParserService.ParseInformationUpdated += ParseInfoUpdated; ParserService.ParseInformationUpdated += ParseInfoUpdated;
} }
void ParseInfoUpdated(object sender, EventArgs e) void ParseInfoUpdated(object sender, ParseInformationEventArgs e)
{ {
if (this.editor == null || string.IsNullOrEmpty(this.editor.FileName)) if (this.editor == null || !FileUtility.IsEqualFileName(this.editor.FileName, e.FileName))
return;
ParseInformation info = ParserService.GetExistingParseInformation(this.editor.FileName);
if (info == null || !(info.CompilationUnit is XamlCompilationUnit))
return; 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); UpdateTree(cu.TreeRootNode);
} }

Loading…
Cancel
Save