public RecoverWindow(MainWindow mainW)
        {
            InitializeComponent();
            this.mainW              = mainW;
            DelYesNoQuestion        = AskYesNoQuestion;
            DelCloseWindow          = () => { this.Close(); return; };
            DelSetRecProgressValues = SetRecProgressValues;

            RecoverEntryList = new List <recoverListEntry>();
            RecoverEntryList.Add(new recoverListEntry()
            {
                Name = "Caricamento in corso...", lastMod = ""
            });
            recoverListView.ItemsSource = RecoverEntryList;

            recInfos            = new RecoverInfos();
            RecoverViewModeList = new List <string> {
                "file da tutte le versioni"
            };
            comboRecoverViewMode.ItemsSource = RecoverViewModeList;
            //seleziono prima stringa (file da tutte le versioni)
            comboRecoverViewMode.SelectedIndex = 0;
            versionToDisplay           = -1;
            this.buttRecover.IsEnabled = false;
        }
        public RecoverInfos askForRecoverInfo()
        {
            //todo: remove
            if (DEBUGGING_NO_SERVER)
            {
                RecoverInfos risdbg = new RecoverInfos();
                risdbg.addRawRecord("C:\\DATI\\poli\\Programmazione di Sistema\\progetto_client\\cartella_test\\1\r\n000000111111111100000000000000000000000000000000", 1);
                risdbg.addRawRecord("C:\\DATI\\poli\\Programmazione di Sistema\\progetto_client\\cartella_test\\2\r\n000000111111111100000000000000000000000000000000", 2);
                risdbg.addRawRecord("C:\\DATI\\poli\\Programmazione di Sistema\\progetto_client\\cartella_test\\3\r\n000000111111111100000000000000000000000000000000", 3);
                risdbg.addRawRecord("C:\\DATI\\poli\\Programmazione di Sistema\\progetto_client\\cartella_test\\4\r\n000000111111111100000000000000000000000000000000", 4);
                risdbg.addRawRecord("C:\\DATI\\poli\\Programmazione di Sistema\\progetto_client\\cartella_test\\5\r\n000000111111111100000000000000000000000000000000", 5);
                risdbg.addRawRecord("C:\\DATI\\poli\\Programmazione di Sistema\\progetto_client\\cartella_test\\6\r\n000000111111111100000000000000000000000000000000", 5);
                risdbg.addRawRecord("C:\\DATI\\poli\\Programmazione di Sistema\\progetto_client\\cartella_test\\7\r\n000000111111111100000000000000000000000000000000", 7);
                risdbg.addRawRecord("percorso\r\n000000111111111100000000000000000000000000000000", 1);
                return(risdbg);
            }
            //*/
            sendToServer(commRecoverInfo);
            waitForAck(commCmdAckFromServer);

            RecoverInfos ris = new RecoverInfos();

            try
            {
                //leggi numero di versioni
                int numVers = Convert.ToInt32(socketReadline());
                if (numVers == 0)
                {
                    MyLogger.debug("primo backup necessario");
                    return(null);
                }
                int nFile;
                int nVersCurr;
                //per ogni versione
                for (int bv = 1; bv <= numVers; bv++)
                {
                    nVersCurr = Convert.ToInt32(socketReadline());
                    if (nVersCurr != bv)
                    {
                        throw new Exception("nVersCurr != bv !!!!");
                    }
                    nFile = Convert.ToInt32(socketReadline());
                    //per ogni file
                    for (int f = 0; f < nFile; f++)
                    {
                        // [Percorso completo]\r\n[Ultima modifica -> 16byte][Hash -> 32char]\r\n
                        ris.addRawRecord(socketReadline() + "\r\n" + socketReadline(), bv);
                        sendToServer(commDataRec);
                    }
                }
            }
            catch (Exception e)
            {
                MyLogger.debug("errore in askForRecoverInfo\n");
                MyLogger.debug(e.ToString());
                throw;
            }
            return(ris);
        }
        //public void cleanRecovered()
        //{
        //    //lo rimuovo dalla lista di RecoverEntry
        //    RecoverEntryList.Remove(RListRecoveringEntry);
        //    //rimuovo anche dall'oggetto RecoverInfos in mainW.
        //    recInfos.removeRecoverRecord(RListRecoveringEntry.rr);
        //    //refresh della listView
        //    recoverListView.Items.Refresh();
        //}

        internal void setRecoverInfos(RecoverInfos recInfos)
        {
            if (recInfos != null)
            {
                this.recInfos = recInfos;
            }
            showRecoverInfos();
            updateRecoverViewModes();
        }
 private void setRecoverInfos(RecoverInfos recInfo)
 {
     recoverW.setRecoverInfos(recInfo);
 }
 public RecoveringQuery_st(RecoverInfos recInfos, int versionToRecover, string recoveringFolderPath)
 {
     this.recInfos             = recInfos;
     this.versionToRecover     = versionToRecover;
     this.recoveringFolderPath = recoveringFolderPath;
 }