Esempio n. 1
0
        public void SaveAndCheckSettings()
        {
            // Save everything
            if (SettingsManager.Current.SettingsChanged)
            {
                SettingsManager.Save();
            }

            if (NetworkInterfaceProfileManager.ProfilesChanged)
            {
                NetworkInterfaceProfileManager.Save();
            }

            if (IPScannerProfileManager.ProfilesChanged)
            {
                IPScannerProfileManager.Save();
            }

            if (PortScannerProfileManager.ProfilesChanged)
            {
                PortScannerProfileManager.Save();
            }

            if (PingProfileManager.ProfilesChanged)
            {
                PingProfileManager.Save();
            }

            if (TracerouteProfileManager.ProfilesChanged)
            {
                TracerouteProfileManager.Save();
            }

            if (RemoteDesktopSessionManager.SessionsChanged)
            {
                RemoteDesktopSessionManager.Save();
            }

            if (PuTTYSessionManager.SessionsChanged)
            {
                PuTTYSessionManager.Save();
            }

            if (WakeOnLANClientManager.ClientsChanged)
            {
                WakeOnLANClientManager.Save();
            }

            // Check if files exist
            ApplicationSettingsExists      = File.Exists(SettingsManager.GetSettingsFilePath());
            NetworkInterfaceProfilesExists = File.Exists(NetworkInterfaceProfileManager.GetProfilesFilePath());
            IPScannerProfilesExists        = File.Exists(IPScannerProfileManager.GetProfilesFilePath());
            PortScannerProfilesExists      = File.Exists(PortScannerProfileManager.GetProfilesFilePath());
            PingProfilesExists             = File.Exists(PingProfileManager.GetProfilesFilePath());
            TracerouteProfilesExists       = File.Exists(TracerouteProfileManager.GetProfilesFilePath());
            RemoteDesktopSessionsExists    = File.Exists(RemoteDesktopSessionManager.GetSessionsFilePath());
            PuTTYSessionsExists            = File.Exists(PuTTYSessionManager.GetSessionsFilePath());
            WakeOnLANClientsExists         = File.Exists(WakeOnLANClientManager.GetClientsFilePath());
        }
Esempio n. 2
0
        private void Application_Exit(object sender, ExitEventArgs e)
        {
            // Save settings, when the application is normally closed
            if (!_singleInstanceClose && !ImportExportManager.ForceRestart && !CommandLineManager.Current.Help)
            {
                // Save local settings (custom settings path in AppData/Local)
                Settings.Default.Save();

                if (SettingsManager.Current.SettingsChanged) // This will also create the "Settings" folder, if it does not exist
                {
                    SettingsManager.Save();
                }

                if (CredentialManager.CredentialsChanged)
                {
                    CredentialManager.Save();
                }

                if (NetworkInterfaceProfileManager.ProfilesChanged)
                {
                    NetworkInterfaceProfileManager.Save();
                }

                if (IPScannerProfileManager.ProfilesChanged)
                {
                    IPScannerProfileManager.Save();
                }

                if (PortScannerProfileManager.ProfilesChanged)
                {
                    PortScannerProfileManager.Save();
                }

                if (PingProfileManager.ProfilesChanged)
                {
                    PingProfileManager.Save();
                }

                if (TracerouteProfileManager.ProfilesChanged)
                {
                    TracerouteProfileManager.Save();
                }

                if (RemoteDesktopSessionManager.SessionsChanged)
                {
                    RemoteDesktopSessionManager.Save();
                }

                if (PuTTYSessionManager.SessionsChanged)
                {
                    PuTTYSessionManager.Save();
                }

                if (WakeOnLANClientManager.ClientsChanged)
                {
                    WakeOnLANClientManager.Save();
                }
            }
        }