static internal bool TrySwitchToLastSavedTab(BulkEditBar bulkEditBar)
{
BulkEditTabPageSettings settings;
// first try to deserialize stored settings.
settings = BulkEditTabPageSettings.DeserializeLastTabPageSettings(bulkEditBar);
// get the name of the tab. if we can't get this, no point in continuing to use the settings,
// because all other settings depend upon the tab.
if (settings.AreLoaded)
{
bool fOk = true;
// try switching to saved tab.
try
{
BulkEditBarTabs tab = (BulkEditBarTabs)Enum.Parse(typeof(BulkEditBarTabs), settings.TabPageName);
bulkEditBar.m_operationsTabControl.SelectedIndex = (int)tab;
}
catch
{
// something went wrong trying to restore tab, so assume we didn't switch to a saved one.
fOk = false;
}
return fOk;
}
return false;
}