Exemplo n.º 1
0
        /// <summary>
        /// Handle files when indexing, not invoked by any event
        /// <param name="item">Item to process</param>
        /// <param name="ftpClient">Client to process</param>
        /// </summary>
        public void ProcessIndexing(SyncQueueItem item, FtpClient ftpClient)
        {
            switch (item.SyncTo)
            {
            case ToSync.ToFtp:
                Task.Run(() => { ftpClient.UploadFile(item); });
                break;

            case ToSync.ToLocal:
                Task.Run(() => { ftpClient.DownloadFile(item); });
                break;

            case ToSync.IsIdentical:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Handles file change event and executes ftp client task for specific item
 /// <param name="item">Item to process</param>
 /// <param name="ftpClient">Client to process</param>
 /// </summary>
 public void ChangeItem(SyncQueueItem item, FtpClient ftpClient)
 {
     Task.Run(() => { ftpClient.UploadFile(item); });
 }