protected override void OnStartup(StartupEventArgs e) { string message = string.Empty; if (File.Exists(m_PropertyPersistenceFileName)) { message = "I will now attempt to load the following file:\n" + m_PropertyPersistenceFileName + "\n\nThis file will be overwritten when the application closes."; } else { message = "I could not find the following file:\n" + m_PropertyPersistenceFileName + "\n\nIt will be created when the application closes."; } MessageBox.Show(message, "Pay attention!", MessageBoxButton.OK); PropertyStateHelper.Load(m_StateResourceAccess); base.OnStartup(e); }
protected override void OnExit(ExitEventArgs e) { PropertyStateHelper.Save(m_StateResourceAccess); base.OnExit(e); }