private static void FieldWorks_OnSave(object sender, SaveEventArgs e)
{
if (!e.UndoableChanges)
return;
FwRegistrySettings settings = s_settingsForLastClosedWindow;
if (settings == null)
{
IFwMainWnd activeWnd = s_activeMainWnd ?? Form.ActiveForm as IFwMainWnd;
if (activeWnd == null || activeWnd.App == null || activeWnd.App.RegistrySettings == null)
return;
Debug.Assert(activeWnd.Cache == e.Cache && e.Cache == s_cache);
settings = activeWnd.App.RegistrySettings;
}
// We recently closed a window of this application; record it as having recently-saved changes
// for this project.
settings.LatestProject = e.Cache.ProjectId.Handle;
settings.LatestServer = e.Cache.ProjectId.ServerName ?? string.Empty;
}