void read_settings()
        {
            var x_doc = XDocument.Load(settings_path);
            var root  = x_doc.Element("WindowsBackup_App");

            // key_manager, file_name_reg
            key_manager   = new BasicKeyManager(root.Element("BasicKeyManager"));
            file_name_reg = new FileNameRegistration(root.Element("FileNameRegistration"));

            // cloud_backup_services
            cloud_backup_services = new List <CloudBackupService>();
            foreach (var tag in root.Element("cloud_backup_services").Elements())
            {
                if (tag.Name.LocalName.Equals("AWS_CloudBackupService"))
                {
                    cloud_backup_services.Add(new AWS_CloudBackupService(tag));
                }
                else if (tag.Name.LocalName.Equals("AzureBlob_CloudBackupService"))
                {
                    cloud_backup_services.Add(new AzureBlob_CloudBackupService(tag));
                }
                else if (tag.Name.LocalName.Equals("GCP_CloudBackupService"))
                {
                    cloud_backup_services.Add(new GCP_CloudBackupService(tag));
                }
            }
            cloud_backup_services.Sort(compare_two_cloud_backups);

            // backup_manager, restore_manager
            backup_manager = new BackupManager(root.Element("BackupManager"),
                                               file_name_reg, cloud_backup_services, key_manager, handle_event);
            restore_manager = new RestoreManager(root.Element("RestoreManager"),
                                                 cloud_backup_services, key_manager, handle_event);
        }
        void create_default_file()
        {
            // Create a directory if needed.
            var dir_name = Path.GetDirectoryName(settings_path);

            if (Directory.Exists(dir_name) == false)
            {
                Directory.CreateDirectory(dir_name);
            }

            key_manager           = new BasicKeyManager();
            file_name_reg         = new FileNameRegistration(fnr_path);
            cloud_backup_services = new List <CloudBackupService>();
            backup_manager        = new BackupManager();
            restore_manager       = new RestoreManager();

            save_settings();
        }