Add logic to “TryAgainLater” if setting the Top of an EditItem fails.

This commit is contained in:
Rich 2012-04-17 17:24:26 +00:00
parent 10c8ba5eab
commit 62368e725b

View File

@ -1347,6 +1347,12 @@ namespace Volian.Controls.Library
}
}
}
private bool _TryAgainLater = false;
public bool TryAgainLater
{
get { return _TryAgainLater; }
set { _TryAgainLater = value; }
}
/// <summary>
/// Handles movement of the EditItems
/// </summary>
@ -1363,11 +1369,12 @@ namespace Volian.Controls.Library
//}
//if (MyID > _StartingID)
// Console.WriteLine("{0}--------------- {1} Top = {2} Bottom {3}", WatchThisIndent, MyID, Top, Bottom);
if (MyStepPanel.ItemMoving == 0)
if (MyStepPanel.ItemMoving == 0 && !TryAgainLater)
{
//vlnStackTrace.ScrollInStack();
return; // If 0 - Indicates scrolling which requires no action.
}
TryAgainLater = false;
//ShowMe("Move");
if (MyItemInfo == null)
return;
@ -1678,6 +1685,15 @@ namespace Volian.Controls.Library
nextEditItem.LastMethodsPush(string.Format("AdjustLocation {0}", MyID));
nextEditItem._NextDownEditItemPath = _NextDownEditItemPath;
nextEditItem.Top = bottom;
// We found that the 64 Bit version of windows did not always set the Top correctly.
// We also found that if we could simply watch for the next time that it was set, we
// could set the Flag "TryAgainLater" the change would propogate the changes through its
// children and siblings.
if (nextEditItem.Top != bottom)
{
nextEditItem.TryAgainLater = true;
_MyLog.InfoFormat("Setting nextEditItem.Top = bottom for ID {0}, ({1}) did not work, TryAgainLater", nextEditItem.MyID, nextEditItem.MyItemInfo.SearchPath);
}
nextEditItem.LastMethodsPop();
MyStepPanel.ItemMoving--;
}