/// <summary> /// 显示对方信息(IP和主机名) /// </summary> private void displayHostMessage(Code code) { HostCode hostcode = code as HostCode; if (hostcode != null) { DisplayMessage("远程主机信息:\t" + hostcode.IP + "(" + hostcode.Name + ")"); } }
/// <summary> /// 发送主机信息 /// </summary> private void sendHostMessage() { string hostName = ICanSeeYou.Common.Network.GetHostName(); string hostIP = ICanSeeYou.Common.Network.GetIpAdrress(hostName); HostCode code = new HostCode(); code.Head = CodeHead.HOST_MESSAGE; code.Name = hostName; code.IP = hostIP; mainServer.SendCode(code); }
/// <summary> /// 发送主机信息 /// </summary> private void sendHostMessage() { string hostName = NetMessage.GetHostName(); string hostIP = NetMessage.GetIpAdrress(hostName); HostCode code = new HostCode(); code.Head = CodeHead.HOST_MESSAGE; code.Name = hostName; code.IP = hostIP; mainChick.SendCode(code); }
public async void OnStart() { if (String.IsNullOrWhiteSpace(HostCode)) { var msg = _serviceProvider.GetService <IMessage>(); msg.Caption = "Raise Hand"; msg.Text = "Code is required."; await msg.Show(); return; } if (String.IsNullOrWhiteSpace(Name)) { var msg = _serviceProvider.GetService <IMessage>(); msg.Caption = "Raise Hand"; msg.Text = "Name is required."; await msg.Show(); return; } IsEnabled = false; var parms = new Dictionary <string, object>(); parms.Add("HostCode", HostCode.ToUpper()); parms.Add("IsHost", false); parms.Add("Name", Name); ConnectEvent.Instance.Publish(new Connect() { Method = "SET", Parms = parms }); ConnectEvent.Instance.Publish(new Connect() { Method = "SendCheckHostCode", Parms = parms }); await Task.Delay(Decimal.ToInt32(Wait)); IsEnabled = true; if (token != null) { var msg = _serviceProvider.GetService <IMessage>(); msg.Caption = "Raise Hand"; msg.Text = "Invalid Host Code"; await msg.Show(); } }
public void OnLoaded() { token = ConnectEvent.Instance.Subscribe((c) => { if (c.Method == "ReceiveUpdate" && !IsEnabled) { if (c.Parms.ContainsKey("HostCode") && c.Parms["HostCode"].ToString().ToUpper() == HostCode.ToUpper()) { var parms = new Dictionary <string, object>(); parms.Add("HostCode", HostCode.ToUpper()); parms.Add("IsHost", false); parms.Add("Name", Name); if (c.Parms.ContainsKey("UserNames")) { parms.Add("UserNames", c.Parms["UserNames"]); } var i = _navigationState.Navigate(parms); _navigation.Navigate($"Meeting", parms); token.Dispose(); token = null; } } }); }
/// <summary> /// ����������Ϣ /// </summary> private void sendHostMessage() { string hostName = NetMessage.GetHostName(); string hostIP=NetMessage.GetIpAdrress(hostName); HostCode code = new HostCode(); code.Head = CodeHead.HOST_MESSAGE; code.Name = hostName; code.IP = hostIP; mainChick.SendCode(code); }