/// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.ConditionalExitStyle"]/*' />
 protected virtual void ConditionalExitStyle(XhtmlMobileTextWriter writer, Style style)
 {
     if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] == "true")
     {
         return;
     }
     if (CssLocation == StyleSheetLocation.PhysicalFile)
     {
         // Do nothing.  Styles should be handled by CssClass custom attribute.
         return;
     }
     writer.ExitStyle(style);
 }
 /// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.RenderClosingListTag"]/*' />
 protected virtual void RenderClosingListTag(XhtmlMobileTextWriter writer, String tagName)
 {
     if (CssLocation == StyleSheetLocation.PhysicalFile && (String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true")
     {
         writer.WriteEndTag(tagName);
         ConditionalPopPhysicalCssClass(writer);
     }
     else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true")
     {
         writer.ExitStyle(Style);
     }
     else
     {
         writer.WriteEndTag(tagName);
     }
 }
        private void RenderRule(XhtmlMobileTextWriter writer, Color foreColor, int columnSpan)
        {
            if (CssLocation == StyleSheetLocation.PhysicalFile || Device["requiresXhtmlCssSuppression"] == "true")
            {
                // Review: Since, if there is a physical stylesheet, we cannot know the intended foreColor,
                // do not render a rule.
                return;
            }
            writer.Write("<tr>");
            Style hruleStyle = new Style();

            // Rendering <td...> with background color equal to the style's forecolor renders a thin
            // rule with color forecolor, as intended.
            hruleStyle[Style.BackColorKey] = foreColor == Color.Empty ? Color.Black : foreColor;
            NameValueCollection additionalAttributes = new NameValueCollection();

            additionalAttributes["colspan"] = columnSpan.ToString(CultureInfo.InvariantCulture);
            writer.EnterStyleInternal(hruleStyle, "td", StyleFilter.BackgroundColor, additionalAttributes);
            writer.ExitStyle(Style);
            writer.WriteEndTag("tr");
        }
        private void RenderClosingBodyElement(XhtmlMobileTextWriter writer)
        {
            Style formStyle = ((ControlAdapter)Page.ActiveForm.Adapter).Style;

            if (CssLocation == StyleSheetLocation.PhysicalFile)
            {
                writer.WriteEndTag("body");
                if (_pushedCssClassForBody)
                {
                    writer.PopPhysicalCssClass();
                }
            }
            else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true" &&
                     (String)Device[XhtmlConstants.SupportsBodyClassAttribute] != "false")
            {
                writer.ExitStyle(formStyle); // writes the closing body element.
            }
            else
            {
                writer.WriteEndTag("body");
            }
        }
 private void RenderRule (XhtmlMobileTextWriter writer, Color foreColor, int columnSpan) {
     if (CssLocation == StyleSheetLocation.PhysicalFile || Device["requiresXhtmlCssSuppression"] == "true") {
         // Review: Since, if there is a physical stylesheet, we cannot know the intended foreColor,
         // do not render a rule.
         return;
     }
     writer.Write("<tr>");
     Style hruleStyle = new Style();
     // Rendering <td...> with background color equal to the style's forecolor renders a thin
     // rule with color forecolor, as intended.
     hruleStyle[Style.BackColorKey] = foreColor == Color.Empty ? Color.Black : foreColor;
     NameValueCollection additionalAttributes = new NameValueCollection();
     additionalAttributes["colspan"] = columnSpan.ToString(CultureInfo.InvariantCulture);              
     writer.EnterStyleInternal(hruleStyle, "td", StyleFilter.BackgroundColor, additionalAttributes);
     writer.ExitStyle(Style);
     writer.WriteEndTag("tr");            
 }
 /// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.RenderClosingListTag"]/*' />
 protected virtual void RenderClosingListTag(XhtmlMobileTextWriter writer, String tagName) {
     if (CssLocation == StyleSheetLocation.PhysicalFile  && (String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true") {
         writer.WriteEndTag(tagName);
         ConditionalPopPhysicalCssClass(writer);
     }
     else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true") {
         writer.ExitStyle(Style);
     }
     else {
         writer.WriteEndTag(tagName);
     }
 }
 /// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.ConditionalExitStyle"]/*' />
 protected virtual void ConditionalExitStyle(XhtmlMobileTextWriter writer, Style style)  {
     if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] == "true") {
         return;
     }
     if (CssLocation == StyleSheetLocation.PhysicalFile) {
         // Do nothing.  Styles should be handled by CssClass custom attribute.
         return;
     }
     writer.ExitStyle(style);
 }
        /// <include file='doc\XhtmlBasicFormAdapter.uex' path='docs/doc[@for="XhtmlFormAdapter.Render"]/*' />
        public override void Render (XhtmlMobileTextWriter writer) {
            // Note: <head>, <body> rendered by page adapter, as in HTML case.
            String formsAuthCookieName = FormsAuthentication.FormsCookieName;
            if(!Device.SupportsRedirectWithCookie)
            {
                if(formsAuthCookieName != null && formsAuthCookieName.Length > 0)
                {
                    HttpContext.Current.Response.Cookies.Remove(formsAuthCookieName);
                }
            }
            writer.WriteBeginTag ("form");
            writer.WriteAttribute ("id", Control.ClientID);
            writer.WriteAttribute ("method", Control.Method.ToString().ToLower(CultureInfo.CurrentCulture));
            writer.Write (" action=\"");
            RenderPostbackUrl(writer);
            if(Control.Action.Length > 0) {
                if(Control.Action.IndexOf("?", StringComparison.Ordinal) != -1) {
                    writer.Write("&");
                }
                else {
                    writer.Write("?");
                }
            }
            else {
                writer.Write("?");
            }
            writer.Write(Page.UniqueFilePathSuffix);

            if (Control.Method != FormMethod.Get &&
                Control.Action.Length == 0) {   // VSWhidbey 411176: We don't include QueryStringText if Action is explicitly set

                String queryStringText = PreprocessQueryString(Page.QueryStringText);
                if (queryStringText != null && queryStringText.Length > 0) {
                    String amp = (String)Device[XhtmlConstants.SupportsUrlAttributeEncoding] != "false"  ? "&amp;" : "&";
                    writer.Write(amp);
                    if((String)Device[XhtmlConstants.SupportsUrlAttributeEncoding] != "false") {
                        writer.WriteEncodedText(queryStringText);
                    }
                    else {
                        writer.Write(queryStringText);
                    }
                }
            }
            writer.WriteLine ("\">");
            bool needDivStyle = (String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true" &&
                (String)Device["supportsBodyClassAttribute"] == "false";
            if (!needDivStyle) {
                if((String)Device["usePOverDiv"] == "true")
                    writer.WriteFullBeginTag("p");
                else
                    writer.WriteFullBeginTag ("div");
            }
            else {
                if((String)Device["usePOverDiv"] == "true")
                    writer.EnterStyle(Style, "p");
                else
                    writer.EnterStyle (Style, "div");
            }
            RenderPostBackHeader (writer);
            // Renders hidden variables for IPostBackDataHandlers which are
            // not displayed due to pagination or secondary UI.
            RenderOffPageVariables(writer, Control, Control.CurrentPage);
            
            RenderChildren (writer);
            if (!needDivStyle) {
                if((String)Device["usePOverDiv"] == "true")
                    writer.WriteEndTag("p");
                else
                    writer.WriteEndTag ("div");
            }
            else {
                if((String)Device["usePOverDiv"] == "true")
                    writer.ExitStyle(Style);
                else
                    writer.ExitStyle (Style);
            }
            writer.WriteEndTag ("form");
        }
 private void RenderClosingBodyElement(XhtmlMobileTextWriter writer) {
     Style formStyle = ((ControlAdapter)Page.ActiveForm.Adapter).Style;
     if (CssLocation == StyleSheetLocation.PhysicalFile) {
         writer.WriteEndTag("body");
         if (_pushedCssClassForBody) {
             writer.PopPhysicalCssClass();
         }
     }
     else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true" &&
         (String)Device[XhtmlConstants.SupportsBodyClassAttribute] != "false") {
         writer.ExitStyle(formStyle); // writes the closing body element.
     }
     else {
         writer.WriteEndTag ("body");
     }
 }
        /// <include file='doc\XhtmlBasicFormAdapter.uex' path='docs/doc[@for="XhtmlFormAdapter.Render"]/*' />
        public override void Render(XhtmlMobileTextWriter writer)
        {
            // Note: <head>, <body> rendered by page adapter, as in HTML case.
            String formsAuthCookieName = FormsAuthentication.FormsCookieName;

            if (!Device.SupportsRedirectWithCookie)
            {
                if (formsAuthCookieName != null && formsAuthCookieName.Length > 0)
                {
                    HttpContext.Current.Response.Cookies.Remove(formsAuthCookieName);
                }
            }
            writer.WriteBeginTag("form");
            writer.WriteAttribute("id", Control.ClientID);
            writer.WriteAttribute("method", Control.Method.ToString().ToLower(CultureInfo.CurrentCulture));
            writer.Write(" action=\"");
            RenderPostbackUrl(writer);
            if (Control.Action.Length > 0)
            {
                if (Control.Action.IndexOf("?", StringComparison.Ordinal) != -1)
                {
                    writer.Write("&");
                }
                else
                {
                    writer.Write("?");
                }
            }
            else
            {
                writer.Write("?");
            }
            writer.Write(Page.UniqueFilePathSuffix);

            if (Control.Method != FormMethod.Get &&
                Control.Action.Length == 0)     // VSWhidbey 411176: We don't include QueryStringText if Action is explicitly set

            {
                String queryStringText = PreprocessQueryString(Page.QueryStringText);
                if (queryStringText != null && queryStringText.Length > 0)
                {
                    String amp = (String)Device[XhtmlConstants.SupportsUrlAttributeEncoding] != "false"  ? "&amp;" : "&";
                    writer.Write(amp);
                    if ((String)Device[XhtmlConstants.SupportsUrlAttributeEncoding] != "false")
                    {
                        writer.WriteEncodedText(queryStringText);
                    }
                    else
                    {
                        writer.Write(queryStringText);
                    }
                }
            }
            writer.WriteLine("\">");
            bool needDivStyle = (String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true" &&
                                (String)Device["supportsBodyClassAttribute"] == "false";

            if (!needDivStyle)
            {
                if ((String)Device["usePOverDiv"] == "true")
                {
                    writer.WriteFullBeginTag("p");
                }
                else
                {
                    writer.WriteFullBeginTag("div");
                }
            }
            else
            {
                if ((String)Device["usePOverDiv"] == "true")
                {
                    writer.EnterStyle(Style, "p");
                }
                else
                {
                    writer.EnterStyle(Style, "div");
                }
            }
            RenderPostBackHeader(writer);
            // Renders hidden variables for IPostBackDataHandlers which are
            // not displayed due to pagination or secondary UI.
            RenderOffPageVariables(writer, Control, Control.CurrentPage);

            RenderChildren(writer);
            if (!needDivStyle)
            {
                if ((String)Device["usePOverDiv"] == "true")
                {
                    writer.WriteEndTag("p");
                }
                else
                {
                    writer.WriteEndTag("div");
                }
            }
            else
            {
                if ((String)Device["usePOverDiv"] == "true")
                {
                    writer.ExitStyle(Style);
                }
                else
                {
                    writer.ExitStyle(Style);
                }
            }
            writer.WriteEndTag("form");
        }