Beispiel #1
0
        private void button_StartRemoteDesktop_Click(object sender, RoutedEventArgs e)
        {
            List <Computer> computersToRemoteDesktop = computers.FindAll(c => c.isAlive);

            PromptWindow promptWindow = new PromptWindow();

            promptWindow.Left = mainWindow.Left + 250;
            promptWindow.Top  = mainWindow.Top + 250;
            promptWindow.ShowDialog();

            if (promptWindow.getChoice() == PromptWindowChoice.CANCEL)
            {
                return;
            }

            if (promptWindow.getChoice() == PromptWindowChoice.CONNECT &&
                promptWindow.getLogin().Length > 0 && promptWindow.getPassword().Length > 0)
            {
                foreach (Computer c in computersToRemoteDesktop)
                {
                    c.startRemoteDesktop(promptWindow.getLogin(), promptWindow.getPassword());
                }
            }
            else
            {
                foreach (Computer c in computersToRemoteDesktop)
                {
                    c.startRemoteDesktop();
                }
            }
        }