public MainWindow()
 {
     timer.Tick += Timer_Tick;
     folders     = GestioneFileXML.LeggiLista();
     InitializeComponent();
     this.ResizeMode = ResizeMode.CanMinimize;
     if (!string.IsNullOrEmpty(folders.backup_folder) && !string.IsNullOrEmpty(folders.coockedPC_folder))
     {
         Backup_folder.Text    = folders.backup_folder;
         CoockedPC_folder.Text = folders.coockedPC_folder;
         if (folders.coockedPC_folder.Contains(@"contents\bns\CookedPC") && string.IsNullOrEmpty(folders.coockedPC_eng_folder))
         {
             folders.coockedPC_eng_folder = folders.coockedPC_folder + @"\..\..\Local\NCWEST\ENGLISH\CookedPC";
             GestioneFileXML.ScriviXml(folders);
         }
     }
 }
        //manage the path textblock
        private void _Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Controls.Button tb1    = (System.Windows.Controls.Button)sender;
            CommonOpenFileDialog           dialog = new CommonOpenFileDialog();

            dialog.InitialDirectory = @"C:\";
            dialog.IsFolderPicker   = true;
            switch (tb1.Name)
            {
            case "Backup_button":
                if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
                {
                    Backup_folder.Text    = dialog.FileName;
                    folders.backup_folder = dialog.FileName;
                    GestioneFileXML.ScriviXml(folders);
                    TB_console.Inlines.Add("\n-----------------\n!! Backup folder path saved\n");
                }
                break;

            case "CoockedPC_button":
                if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
                {
                    CoockedPC_folder.Text    = dialog.FileName;
                    folders.coockedPC_folder = dialog.FileName;
                    GestioneFileXML.ScriviXml(folders);
                    TB_console.Inlines.Add("\n-----------------\n!! CookedPC folder path saved\n");
                    if (Directory.Exists(folders.coockedPC_folder))
                    {
                        Console.WriteLine(System.IO.Path.GetDirectoryName(folders.coockedPC_folder));
                        if (dialog.FileName.Contains(@"contents\bns\CookedPC"))
                        {
                            folders.coockedPC_eng_folder = folders.coockedPC_folder + @"\..\..\Local\NCWEST\ENGLISH\CookedPC";
                            GestioneFileXML.ScriviXml(folders);
                        }
                    }
                }
                break;
            }
        }