protected override async Task <IEnumerable <NetworkItem> > GetItems() { var browser = new NetworkBrowser(); var computers = await Task.Run(() => browser.GetNetworkComputers()); return(computers.Select(i => new NetworkItem(i))); }
private void Initialize() { this.Drives = new ObservableCollection <Drive>(); foreach (DriveInfo driveInfo in System.IO.DriveInfo.GetDrives()) { this.Drives.Add(new Drive(driveInfo.Name, driveInfo.IsReady)); } this.Nets = new ObservableCollection <NetworkPcs>(); NetworkBrowser nb = new NetworkBrowser(); foreach (string pc in nb.GetNetworkComputers()) { this.Nets.Add(new NetworkPcs(pc)); } }
public Task <IList <string> > GetMachines() { return(Task.Run(() => NetworkBrowser.GetNetworkComputers())); }
public IList <string> GetMachines() { return(NetworkBrowser.GetNetworkComputers()); }