KeeAgent.KeeAgentExt.FilterKeyList C# (CSharp) Method

FilterKeyList() private method

private FilterKeyList ( ICollection list ) : ICollection
list ICollection
return ICollection
        ICollection<ISshKey> FilterKeyList(ICollection<ISshKey> list)
        {
            if (!Options.UserPicksKeyOnRequestIdentities || list.Count <= 1) {
            return list;
              }

              // TODO: Using the main thread here will cause a lockup with IOProtocolExt
              pluginHost.MainWindow.Invoke((MethodInvoker)delegate
              {
            //var zIndex = pluginHost.MainWindow.GetZIndex();
            var dialog = new KeyPicker(list);
            dialog.Shown += (sender, e) => dialog.Activate();
            dialog.TopMost = true;
            dialog.ShowDialog(pluginHost.MainWindow);
            if (dialog.DialogResult == DialogResult.OK) {
              list = dialog.SelectedKeys.ToList();
            } else {
              list.Clear();
            }
            pluginHost.MainWindow.SetWindowPosBottom();
              });
              return list;
        }