Beispiel #1
0
        private void lstBrowse_SelectionChanged(object sender,
                                                NavigationListControl.NavigationEventArgs e)
        {
            var meta = e.Item as MetaListItemInfo;

            if (meta == null)
            {
                return;
            }

            if (!Network.CheckNetwork())
            {
                return;
            }

            if (meta.IsDir)
            {
                NavigateTo(meta.Path);
                return;
            }

            if (meta.Size > 10485760) // 10MB
            {
                MessageBox.Show(Properties.Resources.FileTooLarge);
                return;
            }

            progBusy.IsBusy = true;

            _client.DownloadAsync(meta.Path, x =>
                                  OnFileDownloaded(x, meta.Path,
                                                   meta.Title, meta.Modified),
                                  OnFileDownloadFailed);
        }
Beispiel #2
0
        private void lstBrowse_SelectionChanged(object sender,
                                                NavigationListControl.NavigationEventArgs e)
        {
            var meta = e.Item as MetaListItemInfo;

            if (meta == null)
            {
                return;
            }

            if (!Network.CheckNetwork())
            {
                return;
            }

            if (meta.IsDir)
            {
                NavigateTo(meta.Path);
            }
            else
            {
                progBusy.IsBusy = true;

                _client.DownloadAsync(meta.Path, x =>
                                      OnFileDownloaded(x, meta.Path,
                                                       meta.Title, meta.Modified),
                                      OnFileDownloadFailed);
            }
        }
Beispiel #3
0
 public override void Download(ListItem item,
                               Action <ListItem, byte[]> downloaded)
 {
     _client.DownloadAsync(_info.Path,
                           x => downloaded(item, x), OnError);
 }