示例#1
0
        public static void Main(string[] args)
        {
            string format = @"Format: C:\Testing D:\Testing -d (delete)";

            System.Console.WriteLine($"Commands: 'Exit' or 'Help'.. \n{format}");

            string input = null;

            while (input != "Exit")
            {
                input = System.Console.ReadLine();

                if (input != null)
                {
                    if (input.ToLower() == "help")
                    {
                        System.Console.WriteLine(format);
                    }
                    else if (UserInputValidation.ValidInputFormat(input))
                    {
                        var request = RequestBuilder.GetSyncRequest(input);

                        var response = Bus.Request <SyncRequest, SyncResponse>(request);
                        System.Console.WriteLine($"Files synced from {request.MainDirectory}, to: " +
                                                 $"{request.SyncDirectory}, in {response.SyncTime} ms.");
                    }
                }
            }
        }
示例#2
0
        public void Sync()
        {
            if (UserInputValidation.ValidInputFormat(MainPath, SyncPath, WithDelete))
            {
                var request  = RequestBuilder.GetSyncRequest(MainPath + " " + SyncPath + (WithDelete ? " -d" : ""));
                var response = bus.Request <SyncRequest, SyncResponse>(request);

                LastSync = $"{DateTime.Now} which took: {response.SyncTime}ms";
            }
        }