Ejemplo n.º 1
0
        private void AddTabItem()
        {
            var addDialog = new AddHostDialog();

            addDialog.Owner = Window.GetWindow(this);
            addDialog.ShowDialog();
        }
Ejemplo n.º 2
0
        private void AddHost(object selectedItem)
        {
            AddHostDialog dlg = new AddHostDialog();

            if (dlg.ShowDialog().Value)
            {
                VMHostGroup hostParent = this.SelectedItem as VMHostGroup;
                foreach (string hostname in dlg.HostNames)
                {
                    //check if host is already present
                    if (VMHostGroup.FindParentFor(hostname, vmHostModel.RootVMHostGroup) == null)
                    {
                        hostParent.AddHost(new VMHost(hostname));
                    }
                }
                hostParent.Save();
            }
        }