Limit refresh of items during expansion of a item for the first time to improve performance.
Use the top EditItem to determine absolute location of items on the Step Panel.
This commit is contained in:
parent
4885cfd881
commit
6e65ec7cd0
@ -25,7 +25,18 @@ namespace Volian.Controls.Library
|
|||||||
get { return _VwMode; }
|
get { return _VwMode; }
|
||||||
set { _VwMode = value; }
|
set { _VwMode = value; }
|
||||||
}
|
}
|
||||||
|
private EditItem _TopMostEditItem = null;
|
||||||
|
public EditItem TopMostEditItem
|
||||||
|
{
|
||||||
|
get { return _TopMostEditItem; }
|
||||||
|
set { _TopMostEditItem = value; }
|
||||||
|
}
|
||||||
|
private ItemInfo _ExpandingHLS = null;
|
||||||
|
public ItemInfo ExpandingHLS
|
||||||
|
{
|
||||||
|
get { return _ExpandingHLS; }
|
||||||
|
set { _ExpandingHLS = value; }
|
||||||
|
}
|
||||||
// TODO: This is not correct. There should be a dictionary of Section Layouts
|
// TODO: This is not correct. There should be a dictionary of Section Layouts
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lookup Table to convert ItemInfo.ItemID to EditItem
|
/// Lookup Table to convert ItemInfo.ItemID to EditItem
|
||||||
@ -228,69 +239,11 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructors
|
#region Constructors
|
||||||
private Timer _RefreshTimer = null;
|
|
||||||
public Timer RefreshTimer
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_RefreshTimer == null)
|
|
||||||
{
|
|
||||||
_RefreshTimer = new Timer();
|
|
||||||
_RefreshTimer.Tick += new EventHandler(_RefreshTimer_Tick);
|
|
||||||
}
|
|
||||||
_RefreshTimer.Enabled = false;
|
|
||||||
_RefreshTimer.Interval = 200;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_RefreshTimer.Enabled = true;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
this.VerticalScroll.Visible = true;
|
|
||||||
}
|
|
||||||
return _RefreshTimer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void _RefreshTimer_Tick(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
_RefreshTimer.Enabled = false;
|
|
||||||
while (_RefreshList.Count > 0)
|
|
||||||
{
|
|
||||||
EditItem myEditItem = _RefreshList[0];
|
|
||||||
int newTop = myEditItem.Top;
|
|
||||||
_MyLog.InfoFormat("TimerTick {0}", myEditItem.MyItemInfo.ShortPath);
|
|
||||||
myEditItem.Top = newTop + 100;
|
|
||||||
Application.DoEvents();
|
|
||||||
myEditItem.Top = newTop;
|
|
||||||
_RefreshList.RemoveAt(0);
|
|
||||||
if (_SelectedEditItem != null && _SelectedEditItem.Bottom > Height)
|
|
||||||
ScrollControlIntoView(_SelectedEditItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private List<EditItem> _RefreshList;
|
|
||||||
public List<EditItem> RefreshList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_RefreshList == null)
|
|
||||||
_RefreshList = new List<EditItem>();
|
|
||||||
return _RefreshList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void AddToRefreshList(EditItem myEditItem)
|
|
||||||
{
|
|
||||||
if (!RefreshList.Contains(myEditItem))
|
|
||||||
{
|
|
||||||
RefreshList.Add(myEditItem);
|
|
||||||
RefreshTimer.Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public StepPanel()
|
public StepPanel()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SetupStepPanel();
|
SetupStepPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetupStepPanel()
|
private void SetupStepPanel()
|
||||||
{
|
{
|
||||||
this.BackColorChanged += new EventHandler(StepPanel_BackColorChanged);
|
this.BackColorChanged += new EventHandler(StepPanel_BackColorChanged);
|
||||||
@ -691,6 +644,7 @@ namespace Volian.Controls.Library
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int ToDisplay(string value,int i)
|
public int ToDisplay(string value,int i)
|
||||||
{
|
{
|
||||||
|
if (i < 0) return 0;
|
||||||
string s = value.Split(",".ToCharArray())[i];
|
string s = value.Split(",".ToCharArray())[i];
|
||||||
return ToDisplay(s);
|
return ToDisplay(s);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user