Exemplo n.º 1
0
        private void ShowComputerPickerDialog()
        {
            using (var dialog = new MultipleAgentChooserDialog(Container)) {
                if (dialog.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }

                if (dialog.SelectedItems == null)
                {
                    return;
                }
                foreach (var selectedItem in dialog.SelectedItems)
                {
                    if (selectedItem == null || selectedItem.Item == null)
                    {
                        continue;
                    }
                    var item = selectedItem.Item as ComputerHealthService;
                    if (!String.IsNullOrEmpty(item.PrincipalName) &&
                        !listWatcherNodes.Items.Contains(item.PrincipalName))
                    {
                        listWatcherNodes.Items.Add(item.PrincipalName);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void ShowComputerPickerDialog()
        {
            using (var dialog = new MultipleAgentChooserDialog(Container)) {
                if (dialog.ShowDialog(this) != DialogResult.OK) return;

                if (dialog.SelectedItems == null) return;
                foreach (var selectedItem in dialog.SelectedItems) {
                    if (selectedItem == null || selectedItem.Item == null) continue;
                    var item = selectedItem.Item as ComputerHealthService;
                    if (!String.IsNullOrEmpty(item.PrincipalName) &&
                        !listWatcherNodes.Items.Contains(item.PrincipalName)) {
                        listWatcherNodes.Items.Add(item.PrincipalName);
                    }
                }
            }
        }