Esempio n. 1
0
        public async Task UpdateRunningProcessesInfoAsync()
        {
            var tasks = ManagedHoloLens.Select(x => x.UpdateRunningProcessesAsync()).ToArray();
            await Task.WhenAll(tasks);

            FilterRunningProcesses();
        }
Esempio n. 2
0
        public async Task UpdateAllHoloLensApplicationsAsync()
        {
            await Task.WhenAll(ManagedHoloLens.Select(x => x.UpdateApplicationsAsync()));

            var apps = ManagedHoloLens.SelectMany(x => x.Applications)
                       .GroupBy(x => x.AppId)
                       .Where(x => x.Count() == ManagedHoloLens.Count)
                       .Select(x => x.First())
                       .Select(x => new HoloLensApplication(x.AppId, x.Name, x.PackageName))
                       .OrderBy(x => x.Name);

            ApplicationsSource.Clear();
            foreach (var app in apps)
            {
                ApplicationsSource.Add(app);
            }

            FilterApps();
        }
Esempio n. 3
0
        private void FilterRunningProcesses()
        {
            var processNames = RunningProcessNameFilter?.Split(';')
                               ?.Where(x => !string.IsNullOrEmpty(x))
                               ?.Select(x => x.Trim().ToLower()) ?? Array.Empty <string>();
            var isAll        = !processNames.Any();
            var processInfos = ManagedHoloLens.Select(x => new RunningProcessInfo
            {
                DeviceName       = x.Name,
                RunningProcesses = x.RunningProcesses
                                   .Where(y => isAll ? true : processNames.Any(z => y.Name.ToLower().Contains(z)))
                                   .ToArray(),
            });

            RunningProcessInfosSource.Clear();
            foreach (var pi in processInfos)
            {
                RunningProcessInfosSource.Add(pi);
            }
        }
Esempio n. 4
0
 public Task ConnectAllAsync() => Task.WhenAll(ManagedHoloLens.Select(x => x.ConnectAsync()));