예제 #1
0
        private void getlist()
        {
            int       peernum   = new Random().Next(0, Vault.Peers.Count - 1);
            PeerEntry peerEntry = Vault.Peers.ElementAt(peernum);

            RemoteListInfo list = peerEntry.ServiceProxy.RequestList();
            //List<StorageFileInfo> storage = new List<StorageFileInfo>();

            ShowFiles form = new ShowFiles();

            form.files = list;
            form.peer  = peerEntry;

            form.ShowDialog(this);
        }
예제 #2
0
        internal RemoteListInfo RequestList()
        {
            RemoteListInfo list    = new RemoteListInfo();
            DirectoryInfo  storage = new DirectoryInfo(config.StorageFolder);

            foreach (var item in storage.GetFiles())
            {
                //list.FileList.Add(item.FullName);
                StorageFileInfo sfi = new StorageFileInfo();
                sfi.VirtualPath = item.FullName;
                sfi.Size        = item.Length;
                list.FileList.Add(sfi);
            }

            return(list);
        }