Esempio n. 1
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            // Save the data from our current view control
            if (currentViewControl != null)
            {
                currentViewControl.SaveData();
            }

            // Close our connection
            try
            {
                ManagementInterfaceClient.Disconnect();
            }
            catch
            {
            }

            // Clear out our greeting cache
            string greetingsCacheFolder = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.GreetingsSoundCache);

            if (WOSI.Utilities.FileUtils.GetDirectorySize(greetingsCacheFolder) >= 100000000)
            {
                Directory.Delete(greetingsCacheFolder, true);
            }

            // Clear out our voicemail cache
            string voicemailCacheFolder = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.VoicemailSoundCache);

            if (WOSI.Utilities.FileUtils.GetDirectorySize(voicemailCacheFolder) >= 100000000)
            {
                Directory.Delete(voicemailCacheFolder, true);
            }

            // Unload our pluings
            PluginManager.UnloadPlugins();

            if (Properties.Settings.Default.DisplayShutdownDialog)
            {
                if (connectionError == false)
                {
                    Forms.ShutownForm shutdownForm = new CallButler.Manager.Forms.ShutownForm();

                    shutdownForm.ShowDialog();
                }
            }
        }
Esempio n. 2
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            // Save the data from our current view control
            if (currentViewControl != null)
                currentViewControl.SaveData();

            // Close our connection
            try
            {
                ManagementInterfaceClient.Disconnect();
            }
            catch
            {
            }

            // Clear out our greeting cache
            string greetingsCacheFolder = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.GreetingsSoundCache);

            if (WOSI.Utilities.FileUtils.GetDirectorySize(greetingsCacheFolder) >= 100000000)
                Directory.Delete(greetingsCacheFolder, true);

            // Clear out our voicemail cache
            string voicemailCacheFolder = WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.VoicemailSoundCache);

            if (WOSI.Utilities.FileUtils.GetDirectorySize(voicemailCacheFolder) >= 100000000)
                Directory.Delete(voicemailCacheFolder, true);

            // Unload our pluings
            PluginManager.UnloadPlugins();

            if (Properties.Settings.Default.DisplayShutdownDialog)
            {
                if (connectionError == false)
                {
                    Forms.ShutownForm shutdownForm = new CallButler.Manager.Forms.ShutownForm();

                    shutdownForm.ShowDialog();
                }
            }
        }