<commit_before>﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharpGL
{
    /// <summary>
    /// 支持UI布局的渲染器
    /// </summary>
    public partial class UIRenderer : RendererBase, IUILayout
    {
        private Renderer modernRenderer;

        public Renderer Renderer
        {
            get { return modernRenderer; }
        }

        /// <summary>
        /// 支持UI布局的渲染器
        /// </summary>
        /// <param name="modernRenderer">要渲染的对象</param>
        /// <param name="Anchor">绑定到窗口的哪些边？</param>
        /// <param name="Margin">到绑定边的距离</param>
        /// <param name="Size">UI大小</param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        public UIRenderer(
            Renderer modernRenderer,
            System.Windows.Forms.AnchorStyles Anchor,
            System.Windows.Forms.Padding Margin,
            System.Drawing.Size Size,
            int zNear = -1000,
            int zFar = 1000
            )
        {
            this.modernRenderer = modernRenderer;
            this.Anchor = Anchor;
            this.Margin = Margin;
            this.Size = Size;
            this.zNear = zNear;
            this.zFar = zFar;
        }


        protected override void DoInitialize()
        {
            this.modernRenderer.Initialize();
        }

        protected override void DoRender(RenderEventArgs arg)
        {
            this.modernRenderer.Render(arg);<commit_msg>UIRenderer accepts RenderBase<commit_after>﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharpGL
{
    /// <summary>
    /// 支持UI布局的渲染器
    /// </summary>
    public partial class UIRenderer : RendererBase, IUILayout
    {
        private RendererBase modernRenderer;

        public RendererBase Renderer
        {
            get { return modernRenderer; }
        }

        /// <summary>
        /// 支持UI布局的渲染器
        /// </summary>
        /// <param name="modernRenderer">要渲染的对象</param>
        /// <param name="Anchor">绑定到窗口的哪些边？</param>
        /// <param name="Margin">到绑定边的距离</param>
        /// <param name="Size">UI大小</param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        public UIRenderer(
            RendererBase modernRenderer,
            System.Windows.Forms.AnchorStyles Anchor,
            System.Windows.Forms.Padding Margin,
            System.Drawing.Size Size,
            int zNear = -1000,
            int zFar = 1000
            )
        {
            this.modernRenderer = modernRenderer;
            this.Anchor = Anchor;
            this.Margin = Margin;
            this.Size = Size;
            this.zNear = zNear;
            this.zFar = zFar;
        }


        protected override void DoInitialize()
        {
            this.modernRenderer.Initialize();
        }

        protected override void DoRender(RenderEventArgs arg)
        {
            this.modernRenderer.Render(arg);
{'fraction_non_alphanumeric': 0.11324376199616124, 'fraction_numerical': 0.005118362124120281, 'mean_word_length': 1.712055507372073, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3008127', 'n_tokens_mistral': 928, 'n_tokens_neox': 923, 'n_words': 175}