private void OnLoad(object sender, EventArgs e)
{
if (this.DesignModeAtAll())
{
return;
}
_templateButton.Parent.Controls.Remove(_templateButton);
const int maxMruItems = 3;
var collectionsToShow = _mruList.Paths.Take(maxMruItems).ToList();
if (collectionsToShow.Count() < maxMruItems && Directory.Exists(NewCollectionWizard.DefaultParentDirectoryForCollections))
{
collectionsToShow.AddRange(Directory.GetDirectories(NewCollectionWizard.DefaultParentDirectoryForCollections)
.Select(d => Path.Combine(d, Path.ChangeExtension(Path.GetFileName(d),"bloomCollection")))
.Where(c => RobustFile.Exists(c) && !collectionsToShow.Contains(c))
.OrderBy(c => Directory.GetLastWriteTime(Path.GetDirectoryName(c)))
.Reverse()
.Take(maxMruItems - collectionsToShow.Count()));
}
var count = 0;
foreach (var path in collectionsToShow)
{
AddFileChoice(path, count);
++count;
if (count > maxMruItems)
break;
}
foreach (Control control in tableLayoutPanel2.Controls)
{
if (control.Tag != null && control.Tag.ToString() == "sendreceive")
control.Visible = Settings.Default.ShowSendReceive;
}
}