Ejemplo n.º 1
0
        /// <include file='doc\WmlPageAdapter.uex' path='docs/doc[@for="WmlPageAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            if (RequiresUTF8ContentEncoding())
            {
                Page.Response.ContentEncoding = UTF8Encoding;
            }

            writer.BeginResponse();
            writer.BeginFile(Page.Request.Url.ToString(), _contentType, Page.Response.Charset);

            RenderXmlHeader(writer);

            writer.WriteFullBeginTag("wml");

            if (Device.SupportsCacheControlMetaTag)
            {
                writer.Write(_cacheExpiry);
            }
            else
            {
                Page.Response.AppendHeader("Cache-Control", "max-age=0");
            }

            if (Device.CanCombineFormsInDeck)
            {
                _renderableForms = Page.ActiveForm.GetLinkedForms(OptimumPageWeight);
                Debug.Assert(_renderableForms != null, "_renderableForms is null");
            }
            else
            {
                _renderableForms = new ArrayList();
                _renderableForms.Add(Page.ActiveForm);
            }

            foreach (Form form in _renderableForms)
            {
                RenderForm(writer, form);
            }

            writer.RenderExtraCards();

            writer.WriteEndTag("wml");

            writer.EndFile();
            writer.EndResponse();
        }