本文整理汇总了C#中XhtmlMobileTextWriter.ExitStyle方法的典型用法代码示例。如果您正苦于以下问题:C# XhtmlMobileTextWriter.ExitStyle方法的具体用法?C# XhtmlMobileTextWriter.ExitStyle怎么用?C# XhtmlMobileTextWriter.ExitStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XhtmlMobileTextWriter
的用法示例。
在下文中一共展示了XhtmlMobileTextWriter.ExitStyle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderRule
private void RenderRule (XhtmlMobileTextWriter writer, Color foreColor, int columnSpan) {
if (CssLocation == StyleSheetLocation.PhysicalFile || Device["requiresXhtmlCssSuppression"] == "true") {
// Review: Since, if there is a physical stylesheet, we cannot know the intended foreColor,
// do not render a rule.
return;
}
writer.Write("<tr>");
Style hruleStyle = new Style();
// Rendering <td...> with background color equal to the style's forecolor renders a thin
// rule with color forecolor, as intended.
hruleStyle[Style.BackColorKey] = foreColor == Color.Empty ? Color.Black : foreColor;
NameValueCollection additionalAttributes = new NameValueCollection();
additionalAttributes["colspan"] = columnSpan.ToString(CultureInfo.InvariantCulture);
writer.EnterStyleInternal(hruleStyle, "td", StyleFilter.BackgroundColor, additionalAttributes);
writer.ExitStyle(Style);
writer.WriteEndTag("tr");
}
示例2: RenderClosingListTag
/// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.RenderClosingListTag"]/*' />
protected virtual void RenderClosingListTag(XhtmlMobileTextWriter writer, String tagName) {
if (CssLocation == StyleSheetLocation.PhysicalFile && (String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true") {
writer.WriteEndTag(tagName);
ConditionalPopPhysicalCssClass(writer);
}
else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true") {
writer.ExitStyle(Style);
}
else {
writer.WriteEndTag(tagName);
}
}
示例3: 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");
}
示例4: ConditionalExitStyle
/// <include file='doc\XhtmlBasicControlAdapter.uex' path='docs/doc[@for="XhtmlControlAdapter.ConditionalExitStyle"]/*' />
protected virtual void ConditionalExitStyle(XhtmlMobileTextWriter writer, Style style) {
if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] == "true") {
return;
}
if (CssLocation == StyleSheetLocation.PhysicalFile) {
// Do nothing. Styles should be handled by CssClass custom attribute.
return;
}
writer.ExitStyle(style);
}
示例5: RenderClosingBodyElement
private void RenderClosingBodyElement(XhtmlMobileTextWriter writer) {
Style formStyle = ((ControlAdapter)Page.ActiveForm.Adapter).Style;
if (CssLocation == StyleSheetLocation.PhysicalFile) {
writer.WriteEndTag("body");
if (_pushedCssClassForBody) {
writer.PopPhysicalCssClass();
}
}
else if ((String)Device[XhtmlConstants.RequiresXhtmlCssSuppression] != "true" &&
(String)Device[XhtmlConstants.SupportsBodyClassAttribute] != "false") {
writer.ExitStyle(formStyle); // writes the closing body element.
}
else {
writer.WriteEndTag ("body");
}
}