private Task CopyMovie(FeedItem fi, ProgressBar pb, string TargetPath)
        {
            if (!(TargetPath.EndsWith("\\") || TargetPath.EndsWith("/")))
            {
                TargetPath += '\\';
            }
            string path = System.IO.Path.GetDirectoryName(fi.LocalMovie);
            string file = System.IO.Path.GetFileName(fi.LocalMovie);

            int    index      = path.LastIndexOf('\\');
            string datefolder = path.Substring(index + 1);

            string targetdir = TargetPath + datefolder + '\\';

            if (!System.IO.Directory.Exists(targetdir))
            {
                System.IO.Directory.CreateDirectory(targetdir);
            }

            FileCopier fc = new FileCopier(fi.LocalMovie, targetdir + file);

            fc.OnProgressChanged += (percentage) =>
            {
                Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new Action(() => pb.Value = percentage));
            };

            fc.OnComplete += (() =>
            {
                Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new Action(() => pb.Visibility = Visibility.Hidden));
            });

            return(Task.Run(() =>
            {
                fc.Copy();
            }));
        }
        private Task CopyMovie (FeedItem fi, ProgressBar pb, string TargetPath)
        {
            if (! (TargetPath.EndsWith ("\\") || TargetPath.EndsWith ("/")))
            {
                TargetPath += '\\';
            }
            string path = System.IO.Path.GetDirectoryName (fi.LocalMovie);
            string file = System.IO.Path.GetFileName (fi.LocalMovie);

            int index = path.LastIndexOf ('\\');
            string datefolder = path.Substring (index + 1);

            string targetdir = TargetPath + datefolder + '\\';

            if (!System.IO.Directory.Exists (targetdir))
            {
                System.IO.Directory.CreateDirectory (targetdir);
            }

            FileCopier fc = new FileCopier ( fi.LocalMovie, targetdir + file);

            fc.OnProgressChanged += (percentage) =>
            {
                Application.Current.Dispatcher.BeginInvoke (System.Windows.Threading.DispatcherPriority.Background, new Action (() => pb.Value = percentage));
            };

            fc.OnComplete += (() =>
            {
                Application.Current.Dispatcher.BeginInvoke (System.Windows.Threading.DispatcherPriority.Background, new Action (() => pb.Visibility = Visibility.Hidden));
            });

            return Task.Run (() =>
            {
                fc.Copy ();
            });
        }