[Mwinapi-commits] SF.net SVN: mwinapi: [64] trunk/Tools/WinternalExplorer
Status: Beta
Brought to you by:
schierlm
From: <sch...@us...> - 2008-04-06 14:41:35
|
Revision: 64 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=64&view=rev Author: schierlm Date: 2008-04-06 07:41:30 -0700 (Sun, 06 Apr 2008) Log Message: ----------- Fix a crash when calling TreeNodeData.Equals with an instance of a different subclass as its parameter; reduce flickering when crosshair is dragged Modified Paths: -------------- trunk/Tools/WinternalExplorer/MainForm.cs trunk/Tools/WinternalExplorer/TreeNodeData.cs Property Changed: ---------------- trunk/Tools/WinternalExplorer/ Property changes on: trunk/Tools/WinternalExplorer ___________________________________________________________________ Name: svn:ignore - bin obj *.user + bin obj *.user WinternalExplorer.suo Modified: trunk/Tools/WinternalExplorer/MainForm.cs =================================================================== --- trunk/Tools/WinternalExplorer/MainForm.cs 2008-03-29 13:45:40 UTC (rev 63) +++ trunk/Tools/WinternalExplorer/MainForm.cs 2008-04-06 14:41:30 UTC (rev 64) @@ -215,11 +215,17 @@ this.Cursor = null; } + SelectableTreeNodeData lastNode = null; + private void UpdateSelection(bool includeTree) { SelectableTreeNodeData stnd = SelectFromPoint(lastX, lastY); if (!Visible) Visible = true; - DoSelect(stnd, includeTree); + if (!stnd.Equals(lastNode)) + { + DoSelect(stnd, includeTree); + lastNode = stnd; + } } private SelectableTreeNodeData SelectFromPoint(int lastX, int lastY) @@ -482,4 +488,4 @@ } } } -} \ No newline at end of file +} Modified: trunk/Tools/WinternalExplorer/TreeNodeData.cs =================================================================== --- trunk/Tools/WinternalExplorer/TreeNodeData.cs 2008-03-29 13:45:40 UTC (rev 63) +++ trunk/Tools/WinternalExplorer/TreeNodeData.cs 2008-04-06 14:41:30 UTC (rev 64) @@ -26,7 +26,7 @@ { if (obj == null || GetType() != obj.GetType()) return false; if (mf != ((TreeNodeData)obj).mf) return false; - return Equals((TreeNodeData)obj); + return EqualsInternal((TreeNodeData)obj); } public override int GetHashCode() @@ -34,7 +34,7 @@ return 42; } - public abstract bool Equals(TreeNodeData tnd); + protected abstract bool EqualsInternal(TreeNodeData tnd); } internal abstract class SelectableTreeNodeData : TreeNodeData @@ -90,7 +90,7 @@ get { return NoneControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return true; } @@ -198,7 +198,7 @@ get { return ProcessControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return ((ProcessData)tnd).process.Id == process.Id; } @@ -306,7 +306,7 @@ get { return ThreadControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return ((ThreadData)tnd).thread.Id.Equals(thread.Id); } @@ -411,7 +411,7 @@ get { return WindowControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return ((WindowData)tnd).sw.HWnd == sw.HWnd; } @@ -601,7 +601,7 @@ get { return AccessibilityControl.Instance; } } - public override bool Equals(TreeNodeData tnd) + protected override bool EqualsInternal(TreeNodeData tnd) { return ((AccessibilityData)tnd).accobj.Equals(this.accobj); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |