Beispiel #1
0
        void ResentLayout(ref HelperClass helper, ref ControllerWorker controller, ref string bufS, string layoutName, bool content)
        {
            LayoutWorker layout = GetLayout(layoutName);

            GetStaticPlugins(layout, ref helper);
            layout._Work(helper);
            helper.GetData(layout._GetHelper());
            EchoClass ec = layout._GetNextContent();

            while (ec.type != EchoClass.EchoType.End)
            {
                switch (ec.type)
                {
                case EchoClass.EchoType.String:
                    bufS += (string)ec.param;
                    break;

                case EchoClass.EchoType.Layout:
                    ResentLayout(ref helper, ref controller, ref bufS, (string)ec.param, content);
                    break;

                case EchoClass.EchoType.Content:
                    if (content)
                    {
                        ResentContent(ref helper, ref controller, ref bufS);
                    }
                    break;
                }
                //while (bufS.Length > 16000) {
                //	byte[] buf = Encoding.UTF8.GetBytes(bufS.Substring(0, 16000));
                //	bufS = bufS.Remove(0, 16000);
                //	helper.Context.Response.OutputStream.Write(buf, 0, buf.Length);
                //}
                ec = layout._GetNextContent();
            }
        }