Ejemplo n.º 1
0
        private async void _anperi_HostNotClaimed(object sender, EventArgs e)
        {
            await _anperi.ClaimControl().ConfigureAwait(false);

            await SetLayout(_settings);

            OnPropertyChanged(nameof(HasControl));
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());
            Anperi anperi = new Anperi();

            anperi.Message += Anperi_Message;

            bool exit = false;

            while (!exit)
            {
                Console.WriteLine("type a line to do stuff: periinf, perilay");
                string text = Console.ReadLine();
                anperi.ClaimControl();
                switch (text)
                {
                case "periinf":
                    anperi.RequestPeripheralInfo();
                    break;

                case "perilay":
                    RootGrid rg  = new RootGrid();
                    int      rnd = new Random().Next(1, 10);
                    for (int i = 0; i < rnd; i++)
                    {
                        rg.elements.Add(new Button {
                            column = 1, row = i, id = i, text = "button_" + i
                        });
                    }
                    anperi.SetLayout(rg);
                    break;

                case "exit":
                    exit = true;
                    break;
                }
            }
        }