private static void InitListViewItems(BlueToothCmds oBthCmds)
        {
            ProcessItems.Clear();

            foreach (BluetoothCmd bthCmd in oBthCmds)
            {
                AddListViewItem(bthCmd);
            }

            UpdateListViewItems();
        }
Beispiel #2
0
        private void UpdateProcessItems()
        {
            var processlist = Process.GetProcesses();

            ProcessItems.Clear();
            foreach (var process in processlist)
            {
                if (process.MainWindowHandle == IntPtr.Zero)
                {
                    continue;
                }

                if (string.Equals(process.ProcessName, "explorer", StringComparison.OrdinalIgnoreCase))
                {
                    continue;
                }

                _trace.TraceInformation("Adding process {0}.", process.ProcessName);
                ProcessItems.Add(new ProcessItem(_trace, process));
            }
        }
Beispiel #3
0
        private static void InitListViewItems(BlueToothCmds oBthCmds)
        {
            ProcessItems.Clear();

            if (oBthCmds == null)
            {
                return;
            }

            foreach (BluetoothCmd bthCmd in oBthCmds)
            {
                if (bthCmd.isSelected && bthCmd.Selection_Type == BlueToothCmds.SELECTION_TYPE.NONE)
                {
                    bthCmd.Selection_Type = BlueToothCmds.SELECTION_TYPE.USER;
                }

                if (bthCmd.Selection_Type == BlueToothCmds.SELECTION_TYPE.USER ||
                    bthCmd.Selection_Type == BlueToothCmds.SELECTION_TYPE.USER_PROCESS)
                {
                    AddListViewItem(bthCmd);
                }
            }
        }