ScanMaster.ProfileManager.Exit C# (CSharp) Method

Exit() public method

public Exit ( ) : void
return void
        public void Exit()
        {
            if (ProfilesChanged)
            {
                if (MessageBox.Show("Profile set has been modified. Save ?", "Save profiles", MessageBoxButtons.YesNo,
                    MessageBoxIcon.Exclamation) == DialogResult.Yes)
                {
                    Controller.GetController().SaveProfileSet();
                }
            }
        }

Usage Example

Example #1
0
        // When the main window gets told to shut, it calls this function.
        // In here things that need to be done before the application stops
        // are sorted out.
        public void StopApplication()
        {
            AcquireStop();
            profileManager.Exit();

            // serialize the lastProfileSet path
            if (lastProfileSetPath != null)
            {
                BinaryFormatter bf           = new BinaryFormatter();
                String          settingsPath = (string)Environs.FileSystem.Paths["settingsPath"];
                String          filePath     = settingsPath + "\\ScanMaster\\profilePath.bin";
                FileStream      fs           = File.Open(filePath, FileMode.Create);
                bf.Serialize(fs, lastProfileSetPath);
                fs.Close();
            }

            parameterHelper.Exit();
        }