本文整理汇总了C#中XhtmlMobileTextWriter.EnterStyle方法的典型用法代码示例。如果您正苦于以下问题:C# XhtmlMobileTextWriter.EnterStyle方法的具体用法?C# XhtmlMobileTextWriter.EnterStyle怎么用?C# XhtmlMobileTextWriter.EnterStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XhtmlMobileTextWriter
的用法示例。
在下文中一共展示了XhtmlMobileTextWriter.EnterStyle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: Render
/// <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" ? "&" : "&";
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");
}
示例3: ConditionalEnterStyle
/// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.ConditionalEnterStyle1"]/*' />
protected virtual void ConditionalEnterStyle(XhtmlMobileTextWriter writer, Style style, String tag) {
if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] == "true") {
return;
}
if (CssLocation == StyleSheetLocation.PhysicalFile) {
// Do nothing. Styles should be handled by CssClass custom attribute.
return;
}
if (tag == null || tag.Length == 0) {
writer.EnterStyle(style);
}
else {
writer.EnterStyle(style, tag);
}
}
示例4: 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);
}
}
}