Пример #1
0
        private void lstItems_SelectionChanged(object sender,
                                               NavigationListControl.NavigationEventArgs e)
        {
            if (!Network.CheckNetwork())
            {
                return;
            }

            var item = e.Item as MetaListItemInfo;

            if (item != null)
            {
                if (item.IsDir)
                {
                    RefreshList(item.Path);
                    return;
                }

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

                progBusy.IsBusy = true;
                _client.Download(item.Path,
                                 OnFileDownloaded);

                return;
            }

            var parent = e.Item as ParentItem;

            if (parent != null)
            {
                RefreshList(parent.Path);
            }
        }
Пример #2
0
 public override void Download(ListItem item,
                               Action <ListItem, byte[]> downloaded)
 {
     _client.Download(_info.Path, (_, __, bytes) =>
                      downloaded(item, bytes));
 }