Exemple #1
0
        public Layers(Resolution resolution)
        {
            if (resolution == null)
            {
                throw new ArgumentNullException(nameof(resolution));
            }

            _resolution = resolution;

            Wrapper.AppendChild(_stageWrapper);

            Controls = new Layer(_resolution, Wrapper);
            Wrapper.AppendChild(Controls.CanvasElement);
            Document.Body.AppendChild(Wrapper);

            Wrapper.OnTouchStart  = CancelDefault;
            Wrapper.OnTouchEnd    = CancelDefault;
            Wrapper.OnTouchCancel = CancelDefault;
            Wrapper.OnTouchEnter  = CancelDefault;
            Wrapper.OnTouchLeave  = CancelDefault;
            Wrapper.OnTouchMove   = CancelDefault;
            Wrapper.OnMouseMove   = CancelDefault;
            Wrapper.OnMouseLeave  = CancelDefault;
            Wrapper.OnMouseDown   = CancelDefault;
            Wrapper.OnMouseEnter  = CancelDefault;
            Wrapper.OnMouseOut    = CancelDefault;
            Wrapper.OnMouseOver   = CancelDefault;
            Wrapper.OnMouseUp     = CancelDefault;
            Wrapper.OnMouseWheel  = CancelDefault;
            Wrapper.OnContextMenu = CancelDefault;

            Window.AddEventListener(EventType.Resize, ResizeLayer);
            Window.AddEventListener(EventType.Load, ResizeLayer);
            Window.AddEventListener(EventType.Focus, ResizeLayer);
        }
        protected void Create(int height)
        {
            Wrapper.AppendChild(QuestionDiv);
            Wrapper.AppendChild(new HTMLBRElement());
            Wrapper.AppendChild(AnswerDiv);
            Body.AppendChild(Wrapper);

            ButtonSection.AppendChildrenTabIndex(_buttonCollection.ToArray());

            Height          = height.ToPx();
            AllowSizeChange = false;
        }