Exemplo n.º 1
0
        internal static void OpenTerminalServiceCommandPrompt(IConnectionExtra terminal, string psexecLocation)
        {
            try
            {
                String sessionId = String.Empty;
                if (!terminal.ConnectToConsole)
                {
                    sessionId = TSManager.GetCurrentSession(terminal.Server,
                                                            terminal.UserName,
                                                            terminal.Domain,
                                                            Environment.MachineName).Id.ToString();
                }

                var    process   = new Process();
                String args      = String.Format(" \\\\{0} -i {1} -d cmd", terminal.Server, sessionId);
                var    startInfo = new ProcessStartInfo(psexecLocation, args);
                startInfo.UseShellExecute = false;
                startInfo.CreateNoWindow  = true;
                process.StartInfo         = startInfo;
                process.Start();
            }
            catch (Exception ex)
            {
                string message = String.Format("Could not open the service command prompt.");
                MessageBox.Show(message);
                Logging.Error(message, ex);
            }
        }
Exemplo n.º 2
0
        public void NullCurrentAndConnection_EvaluateDesktopShare_ReturnsDefault()
        {
            IConnectionExtra connection = CreateMockConnection();
            var    desktopShares        = new DesktopShares(connection, EXPECTED);
            string result = desktopShares.EvaluateDesktopShare(string.Empty);

            Assert.AreEqual(EXPECTED, result, "If current desktop share is available, it is not modified.");
        }
Exemplo n.º 3
0
        public void DefaultShareAndConnection_EvaluateDesktopShare_ReturnsEvaluated()
        {
            IConnectionExtra connection = CreateMockConnection();
            // check, that user both case to check case sensitivity.
            var          desktopShares = new DesktopShares(connection, "%SERVER%%user%");
            string       result        = desktopShares.EvaluateDesktopShare();
            const string MESSAGE       = "If default share contains 'server' or 'user', they are replaced case sensitve.";

            Assert.AreEqual(EXPECTED_USERSERVER, result, MESSAGE);
        }
Exemplo n.º 4
0
        private void UpdateLookAndFeel(IConnectionExtra terminal)
        {
            // Update the old treeview theme to the new theme
            Native.Methods.SetWindowTheme(this.OptionsTreeView.Handle, "Explorer", null);

            this.panelConnections.CurrentTerminal = terminal;
            this.currentPanel = this.panelStartupShutdown;
            this.OptionsTreeView.SelectedNode = this.OptionsTreeView.Nodes[0];
            this.OptionsTreeView.Select();

            this.DrawBottomLine();
        }
Exemplo n.º 5
0
        public OptionDialog(IConnectionExtra terminal, IPersistence persistence)
        {
            this.ApplySystemFont();

            InitializeComponent();

            this.panelMasterPassword.Security = persistence.Security;
            MovePanelsFromTabsIntoControls();
            settings.ConfigurationChanged += new ConfigurationChangedHandler(this.SettingsConfigFileReloaded);
            LoadSettings();

            this.SetFormSize();
            UpdateLookAndFeel(terminal);
        }
Exemplo n.º 6
0
        internal static void OpenTerminalServiceCommandPrompt(IConnectionExtra terminal, string psexecLocation)
        {
            String sessionId = String.Empty;

            if (!terminal.ConnectToConsole)
            {
                sessionId = TSManager.GetCurrentSession(terminal.Server,
                                                        terminal.UserName,
                                                        terminal.Domain,
                                                        Environment.MachineName).Id.ToString();
            }

            var    process   = new Process();
            String args      = String.Format(" \\\\{0} -i {1} -d cmd", terminal.Server, sessionId);
            var    startInfo = new ProcessStartInfo(psexecLocation, args);

            startInfo.UseShellExecute = false;
            startInfo.CreateNoWindow  = true;
            process.StartInfo         = startInfo;
            process.Start();
        }
Exemplo n.º 7
0
 internal DesktopShares(IConnectionExtra connection, string defaultDesktopShare)
 {
     this.connection          = connection;
     this.defaultDesktopShare = defaultDesktopShare;
 }
Exemplo n.º 8
0
 internal DesktopShares(IConnectionExtra connection, string defaultDesktopShare)
 {
     this.connection = connection;
     this.defaultDesktopShare = defaultDesktopShare;
 }