Esempio n. 1
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();
            }
        }
Esempio n. 2
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;
             }
         }
     });
 }