本文整理汇总了C#中XhtmlMobileTextWriter.PushPhysicalCssClass方法的典型用法代码示例。如果您正苦于以下问题:C# XhtmlMobileTextWriter.PushPhysicalCssClass方法的具体用法?C# XhtmlMobileTextWriter.PushPhysicalCssClass怎么用?C# XhtmlMobileTextWriter.PushPhysicalCssClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XhtmlMobileTextWriter
的用法示例。
在下文中一共展示了XhtmlMobileTextWriter.PushPhysicalCssClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConditionalRenderOpeningDivElement
// 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(">");
}
}
示例2: RenderOpeningListTag
/////////////////////////////////////////////////////////////////////////
// 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: RenderOpeningBodyElement
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);
}
}
}