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