示例#1
0
        /// <summary>
        /// 显示对方信息(IP和主机名)
        /// </summary>
        private void displayHostMessage(Code code)
        {
            HostCode hostcode = code as HostCode;

            if (hostcode != null)
            {
                DisplayMessage("远程主机信息:\t" + hostcode.IP + "(" + hostcode.Name + ")");
            }
        }
示例#2
0
        /// <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);
        }
示例#3
0
        /// <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);
        }
示例#4
0
        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();
            }
        }
示例#5
0
 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;
             }
         }
     });
 }
示例#6
0
文件: Servers.cs 项目: sunpander/VSDT
 /// <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);
 }