本文整理汇总了C#中XhtmlMobileTextWriter.GetCssFormatClassName方法的典型用法代码示例。如果您正苦于以下问题:C# XhtmlMobileTextWriter.GetCssFormatClassName方法的具体用法?C# XhtmlMobileTextWriter.GetCssFormatClassName怎么用?C# XhtmlMobileTextWriter.GetCssFormatClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XhtmlMobileTextWriter
的用法示例。
在下文中一共展示了XhtmlMobileTextWriter.GetCssFormatClassName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderBeginLink
/// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.RenderBeginLink"]/*' />
protected virtual void RenderBeginLink(XhtmlMobileTextWriter writer, String target, String accessKey, Style style, String cssClass, String title) {
writer.WriteBeginTag("a");
writer.Write(" href=\"");
RenderHrefValue (writer, target);
writer.Write("\"");
if (accessKey != null && accessKey.Length > 0) {
writer.WriteAttribute("accesskey", accessKey, true);
}
if (CssLocation != StyleSheetLocation.PhysicalFile) {
String className = writer.GetCssFormatClassName(style);
if (className != null) {
writer.WriteAttribute ("class", className);
}
}
else if (cssClass != null && cssClass.Length > 0) {
writer.WriteAttribute ("class", cssClass, true /* encode */);
}
if (title != null && title.Length > 0) {
writer.WriteAttribute("title", title, true /* encode */);
}
writer.WriteLine(">");
}
示例2: RenderPostBackEventAsAnchor
// For Style/CssClass args, see ASURT 144034
/// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.RenderPostBackEventAsAnchor2"]/*' />
protected virtual void RenderPostBackEventAsAnchor (
XhtmlMobileTextWriter writer,
String argument,
String linkText,
String accessKey,
Style style,
String cssClass) {
writer.WriteBeginTag("a");
writer.Write(" href=\"");
PageAdapter.RenderUrlPostBackEvent(writer, Control.UniqueID /* target */, argument);
writer.Write("\" ");
if (accessKey != null && accessKey.Length > 0) {
writer.WriteAttribute("accesskey", accessKey);
}
if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true") {
if (CssLocation != StyleSheetLocation.PhysicalFile) {
String className = writer.GetCssFormatClassName(style);
if (className != null) {
writer.WriteAttribute ("class", className);
}
}
else if (cssClass != null && cssClass.Length > 0) {
writer.WriteAttribute ("class", cssClass, true /* encode */);
}
}
writer.Write(">");
writer.WriteEncodedText(linkText);
writer.WriteEndTag("a");
}
示例3: Render
/// <include file='doc\XhtmlBasicPhoneCallAdapter.uex' path='docs/doc[@for="XhtmlPhoneCallAdapter.Render"]/*' />
public override void Render(XhtmlMobileTextWriter writer)
{
ConditionalClearPendingBreak(writer);
Style style = Style;
StyleFilter filter = writer.CurrentStyleClass.GetFilter(style);
if ((filter & XhtmlConstants.Layout) != 0) {
ConditionalEnterLayout(writer, style);
}
if (Device.CanInitiateVoiceCall) {
String text = Control.Text;
String phoneNumber = Control.PhoneNumber;
if (text == null || text.Length == 0) {
text = phoneNumber;
}
writer.WriteBeginTag("a");
if ((String)Device["supportsWtai"] == "true") {
writer.Write(" href=\"wtai://wp/mc;");
}
else {
writer.Write(" href=\"tel:");
}
foreach (char ch in phoneNumber) {
if (ch >= '0' && ch <= '9' || ch == '#' || ch == '+') {
writer.Write(ch);
}
}
writer.Write("\"");
ConditionalRenderCustomAttribute(writer, XhtmlConstants.AccessKeyCustomAttribute);
String cssClass = GetCustomAttributeValue(XhtmlConstants.CssClassCustomAttribute);
if (CssLocation != StyleSheetLocation.PhysicalFile) {
String className = writer.GetCssFormatClassName(style);
if (className != null) {
writer.WriteAttribute ("class", className);
}
}
else if (cssClass != null && cssClass.Length > 0) {
writer.WriteAttribute ("class", cssClass, true /* encode */);
}
writer.Write(">");
writer.WriteEncodedText(text);
writer.WriteEndTag("a");
ConditionalSetPendingBreakAfterInline(writer);
}
else {
// Format the text string based on properties
String text = String.Format(
CultureInfo.CurrentCulture,
Control.AlternateFormat,
Control.Text,
Control.PhoneNumber);
String url = Control.AlternateUrl;
// If URI specified, create a link. Otherwise, only text is displayed.
if (url != null && url.Length > 0) {
String cssClass = GetCustomAttributeValue(XhtmlConstants.CssClassCustomAttribute);
String accessKey = GetCustomAttributeValue(XhtmlConstants.AccessKeyCustomAttribute);
RenderBeginLink(writer, url, accessKey, style, cssClass);
writer.WriteEncodedText(text);
RenderEndLink(writer);
ConditionalSetPendingBreakAfterInline(writer);
}
else {
writer.WritePendingBreak();
ConditionalEnterFormat(writer, style);
ConditionalRenderOpeningSpanElement(writer);
writer.WriteEncodedText(text);
ConditionalRenderClosingSpanElement(writer);
ConditionalExitFormat(writer, style);
ConditionalSetPendingBreak(writer);
}
}
if ((filter & XhtmlConstants.Layout) != 0) {
ConditionalExitLayout(writer, style);
}
}