public async Task InitializeAsync() { try { await _userInterfaceService.ShowBusyIndicatorAsync(); InstalledModel = await _restService.GetAsync <AppsModel>(new Uri("api/appx/packagemanager/packages", UriKind.Relative)); var processesModel = await _restService.GetAsync <ProcessesModel>(new Uri("api/resourcemanager/processes", UriKind.Relative)); RunningModel = new AppsModel(); foreach (var process in processesModel.Processes) { var app = InstalledModel.InstalledPackages.FirstOrDefault(p => p.PackageFullName == process.PackageFullName); if (app != null) { RunningModel.InstalledPackages.Add(app); } } // for each running process await _userInterfaceService.HideBusyIndicatorAsync(); } catch (Exception ex) { await _userInterfaceService.ShowFeedbackAsync(ex); } }
public async Task InitializeAsync() { try { await _userInterfaceService.ShowBusyIndicatorAsync(); _timer = new DispatcherTimer(); _timer.Tick += Timer_Tick; _timer.Start(); } catch (Exception ex) { await _userInterfaceService.ShowFeedbackAsync(ex); } }
public async Task InitializeAsync() { try { await _userInterfaceService.ShowBusyIndicatorAsync(); DeviceInfoModel = await _restService.GetAsync <DeviceInfoModel>(new Uri("api/iot/device/information", UriKind.Relative)); _timer = new DispatcherTimer(); _timer.Tick += Timer_Tick; _timer.Start(); } catch (Exception ex) { await _userInterfaceService.ShowFeedbackAsync(ex); } }
public async Task InitializeAsync() { try { await _userInterfaceService.ShowBusyIndicatorAsync(); Model = await _restService.GetAsync <DevicesModel>(new Uri("api/devicemanager/devices", UriKind.Relative)); var sortedModel = new DevicesModel(); BuildHierarchy(Model, sortedModel, Model.DeviceList.Where(d => d.ParentID == null).Select(d => d.ID).FirstOrDefault(), 0); Model = sortedModel; await _userInterfaceService.HideBusyIndicatorAsync(); } catch (Exception ex) { await _userInterfaceService.ShowFeedbackAsync(ex); } }
public async Task InitializeAsync() { try { await _userInterfaceService.ShowBusyIndicatorAsync(); IpConfigModel = await _restService.GetAsync <IpConfigModel>(new Uri("api/networking/ipconfig", UriKind.Relative)); WifiAdapterModel = await _restService.GetAsync <WifiAdapterModel>(new Uri("api/wifi/interfaces", UriKind.Relative)); if (WifiAdapterModel.Interfaces.Length > 0) { WifiNetworksModel = await _restService.GetAsync <WifiNetworksModel>(new Uri(String.Format("api/wifi/networks?interface={0}", WifiAdapterModel.Interfaces[0].GUID.ToString("D")), UriKind.Relative)); } await _userInterfaceService.HideBusyIndicatorAsync(); } catch (Exception ex) { await _userInterfaceService.ShowFeedbackAsync(ex); } }