private void LoadandSaveWinToolbarsLayoutandStateofToolbarsandTools_Load(object sender,
System.EventArgs e)
{
LoadToolbarLayout();
}
private void LoadToolbarLayout()
{
FileStream fs = null;
if (!File.Exists(System.IO.Path.Combine(Application.StartupPath,
@"..\..\ExtraFiles\ToolbarLayout.dat")))
return;
try
{
fs = new FileStream(System.IO.Path.Combine(Application.StartupPath,
@"..\..\ExtraFiles\ToolbarLayout.dat"), FileMode.Open);
fs.Seek(0, SeekOrigin.Begin);
this.ultraToolbarsManager1.LoadFromBinary(fs);
}
finally
{
if (!(fs == null))
{
fs.Close();
}
}
}
private string GetAppPath()
{
DirectoryInfo f = new DirectoryInfo(Application.ExecutablePath);
return f.Parent.FullName;
}
private void LoadandSaveWinToolbarsLayoutandStateofToolbarsandTools_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
SaveToolbarLayout();
}
private void SaveToolbarLayout()
{
FileStream fs = new FileStream("ToolbarLayout.dat", FileMode.OpenOrCreate);
fs.Seek(0, SeekOrigin.Begin);
this.ultraToolbarsManager1.SaveAsBinary(fs, true);
fs.Close();
}