Esempio n. 1
0
        private async Task RefreshLoadProcesses()
        {
            var apps = await AppList.GetRunningApplications();

            if (apps == null)
            {
                return;
            }
            foreach (var p in apps)
            {
                if (p == null)
                {
                    continue;
                }
                if (this._allAppWithPorts.All(x => x.InstancePid != p.InstancePid))
                {
                    var dispatcher = this.Dispatcher;
                    if (dispatcher != null)
                    {
                        await dispatcher.BeginInvoke(new ThreadStart(delegate
                        {
                            p.Icon = AppIcon.GetIcon(p.FullName, false);
                            this._allAppWithPorts.Add(p);
                        }));
                    }
                }
            }
        }