示例#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);
        }
示例#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);
            }
        }
示例#3
0
 public override void Download(ListItem item,
                               Action <ListItem, byte[]> downloaded)
 {
     _client.DownloadAsync(_info.Path,
                           x => downloaded(item, x), OnError);
 }