Ejemplo n.º 1
0
 public List <PortObject> GetPorts()
 {
     try
     {
         return(_portManager.GetPorts());
     }
     catch (Exception ex)
     {
         ErrorLogger.LoggError(ex.StackTrace, ex.Source, ex.Message);
         return(new List <PortObject>());
     }
 }
Ejemplo n.º 2
0
        private void ReloadPorts()
        {
            this.portListView.Items.Clear();
            // get the port list
            List <PortInfo> ports = PortManager.GetPorts();

            // populate the listview
            if (ports != null)
            {
                foreach (PortInfo port in ports)
                {
                    if (this.showOnlyPrintJackPortsCheckBox.Checked)
                    {
                        if (port.MonitorName != "PrintJack")
                        {
                            continue;
                        }
                    }

                    ListViewItem item = new ListViewItem(port.PortName);
                    item.SubItems.Add(port.PortDescription);
                    item.SubItems.Add(port.PrinterName);
                    this.portListView.Items.Add(item);
                }
            }
        }