using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace barry
{
    public class BackupConfig
    {
        // ID
        public string machine_guid;

        // target or source of the backup (it is a directory on the local computer) 
        public string dir_path;

        // (optional) a sub-diretory of the current device
        public string local_subdir = "";

        // operation type
        // 1 for a backup of the device on the computer (default)
        // 0 for nothing
        // -1 for a backup of the computer on the device
        public int bkp_type = 1;

        // last backup
        public string last_bkp_date = "Never";
        public string last_bkp_result = "";
        public string last_bkp_target = "";


        /// <summary>
        /// return an explicative text about what barry is going to do
        /// </summary>
        /// <returns></returns>
        public string describe()
        {
            Methods methods = new Methods();
            string msg = "";
            if (bkp_type == 0)
            {
                msg = "Simple: Barry won't do nothing.";
            }
            else if (bkp_type == 1)
            {
                msg = String.Format("Barry will copy all of your files and directories:\nFrom your USB Device, in {0}\n To your computer, in {1}", methods.current_drive_letter() + local_subdir, dir_path);
            }
            else if (bkp_type == 1)
            {
                msg = String.Format("Barry will copy all of your files and directories:\nFrom your computer, in {1}\n To your USB Device, in {0}", methods.current_drive_letter() + local_subdir, dir_path);
            }
            else
            {
                msg = "Problem: Barry don't know what he should do. And he do not like it...";
            }

            msg += "\nThe last time Barry did that was " + last_bkp_date + ", and it was a " + last_bkp_result;
            return msg;
        }


    }
}
