コード例 #1
0
        private void RenderOpeningBodyElement(XhtmlMobileTextWriter writer)
        {
            Form  activeForm = Page.ActiveForm;
            Style formStyle  = ((ControlAdapter)activeForm.Adapter).Style;

            if (CssLocation == StyleSheetLocation.PhysicalFile)
            {
                String cssClass = (String)activeForm.CustomAttributes[XhtmlConstants.CssClassCustomAttribute];
                writer.WriteBeginTag("body");
                if (cssClass != null && (String)Device["supportsBodyClassAttribute"] != "false")
                {
                    writer.WriteAttribute("class", cssClass, true /* encode */);
                    writer.PushPhysicalCssClass(cssClass);
                    _pushedCssClassForBody = true;
                }
                writer.Write(">");
            }
            else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true" &&
                     (String)Device[XhtmlConstants.SupportsBodyClassAttribute] != "false")
            {
                writer.EnterStyle(formStyle, "body");
            }
            else
            {
                writer.WriteFullBeginTag("body");
                if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true" &&
                    (String)Device[XhtmlConstants.SupportsBodyClassAttribute] == "false")
                {
                    writer.SetBodyStyle(formStyle);
                }
            }
        }
コード例 #2
0
        /////////////////////////////////////////////////////////////////////////
        // SPECIALIZED UTILITY METHODS FOR LIST SELECTIONLIST OBJECTLIST
        /////////////////////////////////////////////////////////////////////////

        // tagname can be any of table, ul, ol.  See the list adapters for examples.
        /// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.RenderOpeningListTag"]/*' />
        protected virtual void RenderOpeningListTag(XhtmlMobileTextWriter writer, String tagName)
        {
            String classAttribute = (String)Control.CustomAttributes[XhtmlConstants.CssClassCustomAttribute];

            if (CssLocation == StyleSheetLocation.PhysicalFile && (String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true")
            {
                writer.WritePendingBreak();
                writer.WriteBeginTag(tagName);
                if (classAttribute != null &&
                    classAttribute.Length > 0 &&
                    writer.DiffersFromCurrentPhysicalCssClass(classAttribute))
                {
                    writer.WriteAttribute("class", classAttribute, true);
                    writer.PushPhysicalCssClass(classAttribute);
                    Debug.Assert(!_physicalCssClassPushed, "These calls should not be nested.");
                    _physicalCssClassPushed = true;
                }
                writer.Write(">");
            }
            else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true")
            {
                writer.WritePendingBreak();
                StyleFilter filter = writer.CurrentStyleClass.GetFilter(Style);
                writer.EnterStyle(new XhtmlFormatStyleClass(Style, filter), tagName);
            }
            else
            {
                writer.WritePendingBreak();
                writer.WriteFullBeginTag(tagName);
            }
        }
コード例 #3
0
        // Render opening <div class=...> in case the stylesheet location has been specified as a physical file.
        /// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.ConditionalRenderOpeningDivElement"]/*' />
        protected virtual void ConditionalRenderOpeningDivElement(XhtmlMobileTextWriter writer)
        {
            if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] == "true")
            {
                return;
            }
            String classAttribute = (String)Control.CustomAttributes[XhtmlConstants.CssClassCustomAttribute];

            if (CssLocation == StyleSheetLocation.PhysicalFile)
            {
                writer.WriteLine();
                if ((String)Device["usePOverDiv"] == "true")
                {
                    writer.WriteBeginTag("p");
                }
                else
                {
                    writer.WriteBeginTag("div");
                }
                if (classAttribute != null &&
                    classAttribute.Length > 0 &&
                    writer.DiffersFromCurrentPhysicalCssClass(classAttribute))
                {
                    writer.WriteAttribute("class", classAttribute, true);
                    writer.PushPhysicalCssClass(classAttribute);
                    Debug.Assert(!_physicalCssClassPushed, "These calls should not be nested.");
                    _physicalCssClassPushed = true;
                }
                writer.Write(">");
            }
        }
コード例 #4
0
        /////////////////////////////////////////////////////////////////////////
        // SPECIALIZED UTILITY METHODS FOR LIST SELECTIONLIST OBJECTLIST
        /////////////////////////////////////////////////////////////////////////

        // tagname can be any of table, ul, ol.  See the list adapters for examples.
        /// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.RenderOpeningListTag"]/*' />
        protected virtual void RenderOpeningListTag(XhtmlMobileTextWriter writer, String tagName) {            
            String classAttribute = (String) Control.CustomAttributes[XhtmlConstants.CssClassCustomAttribute];
            if (CssLocation == StyleSheetLocation.PhysicalFile && (String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true") {
                writer.WritePendingBreak();
                writer.WriteBeginTag(tagName);            
                if (classAttribute != null && 
                    classAttribute.Length > 0 &&
                    writer.DiffersFromCurrentPhysicalCssClass(classAttribute)) {
                    writer.WriteAttribute("class", classAttribute, true);
                    writer.PushPhysicalCssClass(classAttribute);
                    Debug.Assert(!_physicalCssClassPushed, "These calls should not be nested.");
                    _physicalCssClassPushed = true;
                }
                writer.Write(">");
            }
            else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true") {
                writer.WritePendingBreak();
                StyleFilter filter = writer.CurrentStyleClass.GetFilter(Style);
                writer.EnterStyle(new XhtmlFormatStyleClass(Style, filter), tagName);
            }
            else {
                writer.WritePendingBreak();
                writer.WriteFullBeginTag(tagName);
            }
        }
コード例 #5
0
 // Render opening <div class=...> in case the stylesheet location has been specified as a physical file.
 /// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.ConditionalRenderOpeningDivElement"]/*' />
 protected virtual void ConditionalRenderOpeningDivElement(XhtmlMobileTextWriter writer) {
     if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] == "true") {
         return;
     }
     String classAttribute = (String) Control.CustomAttributes[XhtmlConstants.CssClassCustomAttribute];
     if (CssLocation == StyleSheetLocation.PhysicalFile) {
         writer.WriteLine();
         if ((String)Device["usePOverDiv"] == "true") {
             writer.WriteBeginTag("p");
         }
         else {
             writer.WriteBeginTag("div");
         }
         if (classAttribute != null && 
             classAttribute.Length > 0 &&
             writer.DiffersFromCurrentPhysicalCssClass(classAttribute)) {
             writer.WriteAttribute("class", classAttribute, true);
             writer.PushPhysicalCssClass(classAttribute);
             Debug.Assert(!_physicalCssClassPushed, "These calls should not be nested.");
             _physicalCssClassPushed = true;
         }
         writer.Write(">");
     }
 }
コード例 #6
0
 private void RenderOpeningBodyElement(XhtmlMobileTextWriter writer) {
     Form activeForm = Page.ActiveForm;
     Style formStyle = ((ControlAdapter)activeForm.Adapter).Style;
     if (CssLocation == StyleSheetLocation.PhysicalFile) {
         String cssClass = (String) activeForm.CustomAttributes[XhtmlConstants.CssClassCustomAttribute];
         writer.WriteBeginTag("body");
         if (cssClass != null  && (String)Device["supportsBodyClassAttribute"] != "false") {
             writer.WriteAttribute("class", cssClass, true /* encode */);
             writer.PushPhysicalCssClass(cssClass);
             _pushedCssClassForBody = true;
         }
         writer.Write(">");
     }
     else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true" &&
         (String)Device[XhtmlConstants.SupportsBodyClassAttribute] != "false") {
         writer.EnterStyle(formStyle, "body");
     }
     else {
         writer.WriteFullBeginTag("body");    
         if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true" &&
             (String)Device[XhtmlConstants.SupportsBodyClassAttribute] == "false") {
             writer.SetBodyStyle(formStyle);
         }
     }
 }