public Display(int id, AxRDPViewer rdpDisplay, Label label, Status state = Status.Empty) { this.Id = id; this.RdpDisplay = rdpDisplay; this.Label = label; this.State = state; }
public Display(int id, AxRDPViewer rdpDisplay, int connectionId, Label label, Status state = Status.Busy) { this.Id = id; this.RdpDisplay = rdpDisplay; this.ConnectionId = connectionId; this.State = state; this.Label = label; }
/// <summary> /// Constructor <see cref="RemoteTeminalManager"/>. /// </summary> /// <param name="axRdpViewer"><see cref="AxRDPViewer"/> instance.</param> public RemoteTeminalManager(AxRDPViewer axRdpViewer) { if (axRdpViewer == null) { throw new ArgumentNullException(nameof(axRdpViewer)); } _axRdpViewer = axRdpViewer; }
private void CreateRdpViewerMethod(ref TabPage myTabPage) { AxRDPViewer axRDPViewer = new AxRDPViewer(); axRDPViewer.Name = $"rdpViewer{connectionId}"; axRDPViewer.Location = new Point(0, 0); axRDPViewer.Size = new Size(790, 445); myTabPage.Controls.Add(axRDPViewer); }
public static void disconnect(AxRDPViewer display) { try { display.Disconnect(); } catch (Exception e) { } }
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // Remote desktop connection handler /// <summary>Creates the remote desktop viewer and connects to the server.</summary> private void ConnectRemoteDesktop() { rmdView = new AxRDPViewer(); // Creating instance of the Remote Desktop Viewer windowshost_RMT.Child = rmdView; // Add the viewer to the windows forms host rmdView.OnConnectionTerminated += new _IRDPSessionEvents_OnConnectionTerminatedEventHandler(ConLostRD); // Listener for connection terminated event from the viewer try { //rmdView.Connect(connection.GetInvitation(), "", ""); // Connects to the remote desktop server based on the invitation received in the connection process rmdView.SmartSizing = IsEnabled; // Size the remote desktop window to the viewers size } catch (Exception exc) { } }
public string Connect(string invitation, AxRDPViewer display, string userName, string password) { try { display.Connect(invitation, userName, password); client = new TcpClient(); IPEndPoint IpEnd = new IPEndPoint(IPAddress.Parse(ip.IPAddress.Trim()), ip.Id); client.Connect(IpEnd); return("OK"); } catch (Exception e) { return(e.Message.ToString()); } }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(Form1)); this.axRDPViewer1 = new AxRDPViewer(); this.panel1 = new Panel(); this.axRDPViewer1.BeginInit(); this.panel1.SuspendLayout(); this.SuspendLayout(); this.axRDPViewer1.Dock = DockStyle.Fill; this.axRDPViewer1.Enabled = true; this.axRDPViewer1.Location = new Point(0, 0); this.axRDPViewer1.Margin = new Padding(4, 5, 4, 5); this.axRDPViewer1.Name = "axRDPViewer1"; this.axRDPViewer1.Size = new Size(618, 554); this.axRDPViewer1.TabIndex = 0; this.panel1.Controls.Add((Control)this.axRDPViewer1); this.panel1.Dock = DockStyle.Bottom; this.panel1.Location = new Point(0, 63); this.panel1.Margin = new Padding(4, 5, 4, 5); this.panel1.Name = "panel1"; this.panel1.Size = new Size(618, 554); this.panel1.TabIndex = 4; this.AllowDrop = true; this.AutoScaleDimensions = new SizeF(9f, 20f); this.AutoScaleMode = AutoScaleMode.Font; this.ClientSize = new Size(618, 617); this.Controls.Add((Control)this.panel1); this.Margin = new Padding(4, 5, 4, 5); this.Name = "Form1"; this.StartPosition = FormStartPosition.CenterScreen; this.Text = "LabRun Screen Viewer"; this.WindowState = FormWindowState.Maximized; this.Load += new EventHandler(this.Form1_Load); this.axRDPViewer1.EndInit(); this.panel1.ResumeLayout(false); this.ResumeLayout(false); }
private void ExecuteConnectClient(Connection connection, ICommand cmd) { User user = (User)cmd.GetData()[0]; string connectionString = (string)cmd.GetData()[1]; bool prohibit = (bool)cmd.GetData()[2]; connection.User = user; connection.ProhibitDemo = prohibit; if (!String.IsNullOrEmpty(connectionString)) { connection.ConnectionString = connectionString; var tab = CreateNewTab(connection.ClientIP, true, prohibit); AxRDPViewer viewer = (AxRDPViewer)tab.Controls.Find($"rdpViewer{connectionId}", false).FirstOrDefault(); //Нужно добавить!!! viewer.OnConnectionTerminated += (reason, info) => DeleteConnection(connection.ClientIP, false); viewer.OnApplicationClose += (reason, info) => DeleteConnection(connection.ClientIP, false); viewer.OnAttendeeDisconnected += (reason, info) => DeleteConnection(connection.ClientIP, false); viewer.OnConnectionFailed += (reason, info) => DeleteConnection(connection.ClientIP, false); if (viewer != null) { UpdateGUI.UpdateControl(viewer, "SmartSizing", true); connection.RdpViewer = viewer; connection.TabPage = tab; } } else { var tab = CreateNewTab(connection.ClientIP, false, prohibit); connection.TabPage = tab; MessageBox.Show($"Не удалось получить строку подключения от клиента {connection.ClientIP}. Мониторинг невозможен."); UpdateGUI.UpdateControl(txtStatus, "Text", $"Не удалось получить строку подключения от клиента {connection.ClientIP}."); } }
public static void Disconnect(AxRDPViewer display) { display.Disconnect(); }
public static void Connect(string invitation, AxRDPViewer display, string userName, string password) { display.Connect(invitation, userName, password); }
private static void connect(string invitation, AxRDPViewer display, string userName, string password) { display.Connect(invitation, userName, password); display.SmartSizing = true; //display.Dock = DockStyle.Fill; }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (Form1)); this.axRDPViewer1 = new AxRDPViewer(); this.panel1 = new Panel(); this.axRDPViewer1.BeginInit(); this.panel1.SuspendLayout(); this.SuspendLayout(); this.axRDPViewer1.Dock = DockStyle.Fill; this.axRDPViewer1.Enabled = true; this.axRDPViewer1.Location = new Point(0, 0); this.axRDPViewer1.Margin = new Padding(4, 5, 4, 5); this.axRDPViewer1.Name = "axRDPViewer1"; this.axRDPViewer1.Size = new Size(618, 554); this.axRDPViewer1.TabIndex = 0; this.panel1.Controls.Add((Control) this.axRDPViewer1); this.panel1.Dock = DockStyle.Bottom; this.panel1.Location = new Point(0, 63); this.panel1.Margin = new Padding(4, 5, 4, 5); this.panel1.Name = "panel1"; this.panel1.Size = new Size(618, 554); this.panel1.TabIndex = 4; this.AllowDrop = true; this.AutoScaleDimensions = new SizeF(9f, 20f); this.AutoScaleMode = AutoScaleMode.Font; this.ClientSize = new Size(618, 617); this.Controls.Add((Control) this.panel1); this.Margin = new Padding(4, 5, 4, 5); this.Name = "Form1"; this.StartPosition = FormStartPosition.CenterScreen; this.Text = "LabRun Screen Viewer"; this.WindowState = FormWindowState.Maximized; this.Load += new EventHandler(this.Form1_Load); this.axRDPViewer1.EndInit(); this.panel1.ResumeLayout(false); this.ResumeLayout(false); }
public static void Connect(string invitation, AxRDPViewer display) { display.Connect(invitation, "", ""); display.SmartSizing = true; }