private void btnRefresh_Click(object sender, EventArgs e) { LiveImageAction action = new LiveImageAction(true); action.Perform(); StatusAction status = new StatusAction(true); status.Perform(); }
public void RefreshStatus() { var sign = ControlService.SignCombo.Current; if (sign.DashboardType == DashboardType.Sign && sign.Controller.Connection != null && sign.Controller.Connection.State == System.Communication.ConnectionState.Opened) { LiveImageAction action = new LiveImageAction(false); action.Perform(); StatusAction status = new StatusAction(false); status.Perform(); } }
/// <summary> /// Connect /// </summary> private void DoConnect() { if (connStatus != null) { return; } if (isUseProxy && ddlProxyType.SelectedIndex != 0) { if (txtProxyIpAdd.Text.Trim() == "") { MsgBox.Warning("Sorry,the proxy IP address can't be empty"); return; } if (this.txtProxyPortNo.Text.Trim() == "") { MsgBox.Warning("Sorry,the proxy port number can't be empty"); return; } } Cursor = Cursors.WaitCursor; ConnectionExceptionAction.IsCancel = false; IsDisconnection = false; DashboardTree._currentSign = Current; IPEndPoint endPoint = null; IPEndPoint proxyEndPoint = null; LoginInfo info = new LoginInfo(); if (Current.Template.Sign.AutoLogin || Current.LoginInfomation.CanSave || Current.LoginInfomation.CanSaveLoginInfo) { info = CloneManager.Clone <LoginInfo>(Current.LoginInfomation); } if (chkStorePWD.Checked) { info.CanSave = true; } else { info.CanSave = false; } info.IpAddress = txtConnectIpAddress.Text.Trim(); info.Port = Convert.ToInt32(txtConnectPortNo.Text); info.ConnectionUserName = txtServerName.Text.Trim(); info.ConnectionPassword = txtConnectPWD.Text.Trim(); Current.LoginInfomation.ConnectionUserName = txtServerName.Text.Trim(); Current.LoginInfomation.ConnectionPassword = txtConnectPWD.Text.Trim(); endPoint = new IPEndPoint(IPAddress.Parse(info.IpAddress), info.Port); if (isUseProxy && ddlProxyType.SelectedIndex != 0) { info.PorxyUserName = txtProxyUserName.Text; info.ProxyPort = Convert.ToInt32(txtProxyPortNo.Text); info.PorxyAddress = txtProxyIpAdd.Text; info.ProxyType = (ProxyTypes)Enum.Parse(typeof(ProxyTypes), ddlProxyType.SelectedItem.ToString()); info.PorxyPassword = txtProxyPWD.Text; proxyEndPoint = new IPEndPoint(IPAddress.Parse(this.txtProxyIpAdd.Text), Convert.ToInt32(this.txtProxyPortNo.Text)); } else { info.ProxyType = ProxyTypes.None; } Current.LoginInfomation = info; Current.Controller.Connection.FtpUser.Account = info.ConnectionUserName; Current.Controller.Connection.FtpUser.NoSecurityPWD = info.ConnectionPassword; TcpUFEConnection tcpConn = Current.Controller.Connection as TcpUFEConnection; if (tcpConn != null) { var connParams = new TcpConnectionParams(endPoint, proxyEndPoint, info.ProxyType, info.PorxyUserName, info.PorxyPassword); tcpConn.Params = connParams; } ProWrite.UI.Controls.Actions.UFE.Responses.UFEResponseService.Init(Current); this.Hide(); ConnectionProgress progress = new ConnectionProgress(Current, false, info.ConnectionPassword); progress.ShowModalDialog(); if (!chkStorePWD.Checked) { Current.LoginInfomation.ConnectionPassword = ""; } if (progress.Result) { LiveImageAction liveImageAction = new LiveImageAction(); liveImageAction.Sign = Current; liveImageAction.Perform(); StatusAction statusAction = new StatusAction(false); statusAction.Sign = Current; statusAction.Perform(); GetStatusAction getStatus = new GetStatusAction(); getStatus.sign = Current; getStatus.Perform(); LogViewAction logviewAction = new LogViewAction(); logviewAction.sign = Current; logviewAction.Perform(); if (Current.IsWebCam) { IsConnectWebCam = true; } UpdateSignInfo(); } else { ActionHelper.OnDisconnected(false); this.Show(); this.Cursor = Cursors.Default; } }