Provides a default visual representation of an element, to be used when no element-specific visual representation is available.
Наследование: IElementVisual
        /// <summary>
        /// Renders the specified user interface.
        /// </summary>
        /// <param name="userInterface">The user interface to render.</param>
        public void Render(UserInterface userInterface)
        {
            if (userInterface == null)
                throw new ArgumentNullException("userInterface");

            int y = 0;
            foreach (Element element in userInterface.Container) {
                IElementVisual visual = new DefaultVisual();
                Vector2 size = visual.Measure(this, element);
                visual.Render(this, element, 0, y, (int)size.X, (int)size.Y);
                y += (int)size.Y;
            }

            Flush();
        }
Пример #2
0
        /// <summary>
        /// Renders the specified user interface.
        /// </summary>
        /// <param name="userInterface">The user interface to render.</param>
        public void Render(UserInterface userInterface)
        {
            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            int y = 0;

            foreach (Element element in userInterface.Container)
            {
                IElementVisual visual = new DefaultVisual();
                Vector2        size   = visual.Measure(this, element);
                visual.Render(this, element, 0, y, (int)size.X, (int)size.Y);
                y += (int)size.Y;
            }

            Flush();
        }