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