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); } }
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."); }
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); }
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(); }
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); }
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(); }
internal DesktopShares(IConnectionExtra connection, string defaultDesktopShare) { this.connection = connection; this.defaultDesktopShare = defaultDesktopShare; }