public IpMappingListViewItem(IpMappingItem item, HttpApiPage page) : base(item.Address) { Item = item; _page = page; SubItems.Add(new ListViewSubItem(this, item.Port)); SubItems.Add(new ListViewSubItem(this, BindingUtility.GetAppName(item.AppId))); SubItems.Add(new ListViewSubItem(this, item.AppId)); SubItems.Add(new ListViewSubItem(this, item.Hash)); SubItems.Add(new ListViewSubItem(this, item.Store)); string flag = "Broken"; using X509Store personal = new X509Store(item.Store, StoreLocation.LocalMachine); try { personal.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly); var found = personal.Certificates.Find(X509FindType.FindByThumbprint, item.Hash, false); if (found.Count > 0) { flag = "Healthy"; } personal.Close(); } catch (CryptographicException) { flag = "Unknown"; } SubItems.Add(new ListViewSubItem(this, flag)); }
public IpMappingListViewItem(IpMappingItem item, HttpApiPage page) : base(item.Address) { Item = item; _page = page; SubItems.Add(new ListViewSubItem(this, item.Port)); SubItems.Add(new ListViewSubItem(this, BindingUtility.GetAppName(item.AppId))); SubItems.Add(new ListViewSubItem(this, item.AppId)); SubItems.Add(new ListViewSubItem(this, item.Hash)); SubItems.Add(new ListViewSubItem(this, item.Store)); }