public override void OnReceive(Context context, Intent intent)
 {
     if (RsClient.hubConnection == null || RsClient.hubConnection.State != HubConnectionState.Connected)
     {
         RsClient.BuildOrReBuldHub();
         RsClient.StartAsync();
     }
 }
Exemple #2
0
        protected override void OnResume()
        {
            if (RsClient.hubConnection == null || RsClient.hubConnection.State != HubConnectionState.Connected)
            {
                RsClient.BuildOrReBuldHub();
                RsClient.StartAsync();
            }

            base.OnResume();
        }
Exemple #3
0
        async protected override void OnLoad(EventArgs e)
        {
            #region ico
            ico         = new NotifyIcon();
            ico.Icon    = (Icon)resources.GetObject("$this.Icon");
            ico.Visible = true;

            ico.DoubleClick += delegate(object sender, EventArgs args)
            {
                Show();
                ShowInTaskbar = true;
                WindowState   = FormWindowState.Normal;
            };

            var menuStrip = new ContextMenuStrip();
            menuStrip.Items.Add("Выход", null, delegate
            {
                NoCancel = false;
                Close();
            });

            ico.ContextMenuStrip = menuStrip;
            #endregion

            #region RsClient
            tb_log.Text = "Connection..";

            RsClient.OnDestroy  += () => { };
            RsClient.OnLog      += log => tb_log.Text += log + Environment.NewLine;
            RsClient.OnClearLog += () => tb_log.Text = string.Empty;

            RsClient.BuildOrReBuldHub();
            await RsClient.StartAsync();

            #endregion

            base.OnLoad(e);
        }
Exemple #4
0
        async static Task Main(string[] args)
        {
            RsClient.OnDestroy += () => Console.ForegroundColor = ConsoleColor.Red;
            RsClient.OnLog     += log => Console.WriteLine(log);

            RsClient.OnClearLog += () =>
            {
                if (Environment.OSVersion.Platform == PlatformID.Win32NT)
                {
                    Console.Clear();
                }
            };

            Console.WriteLine("Connection..");
            RsClient.BuildOrReBuldHub();
            await RsClient.StartAsync();

            do
            {
                Console.ReadLine();
                await Task.Delay(40);
            }while (Environment.OSVersion.Platform == PlatformID.Unix);
        }