Beispiel #1
0
        protected override void OnAfterRender(bool firstRender)
        {
            if (!firstRender)
            {
                return;
            }

            _clickListener1 = new ClickListener(_inner1);
            _clickListener1.Execute(JSRuntime);

            _clickListener2 = new ClickListener(_inner2);
            _clickListener2.Execute(JSRuntime);

            _clickListener1.OnOuterClick += (args) =>
                                            Console.WriteLine($"Outer1 -> Outer {args.Button} {args.X} {args.Y} {args.Shift} {args.Control}");
            _clickListener1.OnClick += (args) =>
                                       Console.WriteLine($"Outer1 -> Self  {args.Button} {args.X} {args.Y} {args.Shift} {args.Control}");
            _clickListener1.OnInnerClick += (args) =>
                                            Console.WriteLine($"Outer1 -> Inner {args.Button} {args.X} {args.Y} {args.Shift} {args.Control}");

            _clickListener1.OnInnerClick += (args) => { Console.WriteLine(args.TargetID); };

            _clickListener2.OnOuterClick += (args) =>
                                            Console.WriteLine($"Outer2 -> Outer {args.Button} {args.X} {args.Y} {args.Shift} {args.Control}");
            _clickListener2.OnClick += (args) =>
                                       Console.WriteLine($"Outer2 -> Self  {args.Button} {args.X} {args.Y} {args.Shift} {args.Control}");
            _clickListener2.OnInnerClick += (args) =>
                                            Console.WriteLine($"Outer2 -> Inner {args.Button} {args.X} {args.Y} {args.Shift} {args.Control}");

            //

            KeyListener _keyListener1 = new KeyListener(_inner1);

            _keyListener1.Execute(JSRuntime);

            _keyListener1.OnOuterKeyUp += (args) =>
                                          Console.WriteLine($"Outer1 -> Outer        {args.Key} {args.TargetID} {args.Shift} {args.Control}");
            _keyListener1.OnKeyUp += (args) =>
                                     Console.WriteLine($"Outer1 -> OnKeyUp      {args.Key} {args.TargetID} {args.Shift} {args.Control}");
            _keyListener1.OnInnerKeyUp += (args) =>
                                          Console.WriteLine($"Outer1 -> OnInnerKeyUp {args.Key} {args.TargetID} {args.Shift} {args.Control}");

            //

            Tooltip tooltip = new Tooltip(_inner1, "Tooltip on inner 1");

            tooltip.Execute(JSRuntime);

            Task.Run(() =>
            {
                Thread.Sleep(1000);
                // Utilities.FocusElement(JSRuntime, _text1);
            });
        }
Beispiel #2
0
        protected override void OnAfterRender(bool firstRender)
        {
            if (!firstRender)
            {
                return;
            }

            // Selected - clicks
            _selectedClickListener               = new ClickListener(_selectedRef);
            _selectedClickListener.OnClick      += OnSelectedClick;
            _selectedClickListener.OnInnerClick += OnSelectedInnerClick;
            _selectedClickListener.Execute(JSRuntime);

            // Selected - keys
            _selectedKeyListener          = new KeyListener(_selectedRef);
            _selectedKeyListener.OnKeyUp += OnSelectedKeyUp;
            _selectedKeyListener.Execute(JSRuntime);

            // Options - clicks
            _optionsClickListener = new ClickListener(_optionsRef);
            _optionsClickListener.OnOuterClick += OnOptionsOuterClick;
            _optionsClickListener.OnInnerClick += OnOptionsInnerClick;
            _optionsClickListener.Execute(JSRuntime);

            // Options - keys
            _optionsKeyListener = new KeyListener(_optionsRef);
            _optionsKeyListener.OnInnerKeyUp += OnOptionsInnerKeyUp;
            _optionsKeyListener.Execute(JSRuntime);

            // Input - clicks
            _inputClickListener          = new ClickListener(_inputRef);
            _inputClickListener.OnClick += OnInputClick;
            _inputClickListener.Execute(JSRuntime);

            // Input - keys
            if (FlareSelector.Multiple)
            {
                _inputKeyListener          = new KeyListener(_inputRef);
                _inputKeyListener.OnKeyUp += OnInputKeyUp;
                _inputKeyListener.Execute(JSRuntime);
            }
        }