public static async Task <List <AdapterProfile> > GetListOfAdaptersAsync() { var hostnames = await HostNameProvider.GetConnectedHostsAsync(); var profiles = HostNameProvider.GetCorrespondingProfiles(); List <AdapterProfile> adapters = new List <AdapterProfile>(); for (int i = 0; i < hostnames.Count; i++) { adapters.Add(new AdapterProfile(hostnames[i], profiles[i].ProfileName)); } return(adapters); }
public async Task ListenAllConnectedAsync() { var hostnames = await HostNameProvider.GetConnectedHostsAsync(); if (hostnames.Count == 0) { if (NetworkNotAvailable != null) { NetworkNotAvailable(this, null); } return; } foreach (var host in hostnames) { await server.BindPortAsync(host, SHUB_PORT); } await server.BindPortAsync(HostNameProvider.GetLoopbackHost(), SHUB_PORT); }
private async void bConnect_Click(object sender, RoutedEventArgs e) { origin = DateTime.Now; var host = await HostNameProvider.GetConnectedHostsAsync(); if (host.Count == 0) { event_NetworkNotAvailable(client, null); return; } await server.ListenViaDefaultAsync(); //await client.ScanAsync(host[0]); //ServerLogTime("Scan done"); //await client.ConnectAsync((TClientProfile)clientManager.AvailableFolder[0]); UIChange(true); }
private async void Page_Loaded(object sender, RoutedEventArgs e) { if (!initialized) { initialized = true; var hostnames = await HostNameProvider.GetConnectedHostsAsync(); if (hostnames.Count == 0) { MessageDialog dialog = new MessageDialog( "Network is not available. Please connect to a network and then restart the appplication."); dialog.Commands.Add(new UICommand("Exit application", new UICommandInvokedHandler((c) => { Application.Current.Exit(); }))); await dialog.ShowAsync(); } await client.ActivateAsyncPhone(); } }
public async Task <List <HostName> > GetListOfHostAsync() { return(await HostNameProvider.GetConnectedHostsAsync()); }
public async Task ScanViaDefaultAsync() { await ScanAsync((await HostNameProvider.GetConnectedHostsAsync())[0]); }