protected override void RenderItemDetails(WmlMobileTextWriter writer, ObjectListItem item) { string str1 = (Control.BackCommandText != String.Empty) ? Control.BackCommandText : base.GetDefaultLabel(ControlAdapter.BackLabel); string str2 = (str1.Length > base.Device.MaximumSoftkeyLabelLength) ? null : str1; Style style = Control.LabelStyle; writer.EnterStyle(style); writer.RenderText(item[Control.LabelFieldIndex], true); writer.ExitStyle(style); writer.EnterStyle(base.Style); IObjectListFieldCollection iObjectListFieldCollection = Control.AllFields; int i = 0; IEnumerator iEnumerator = iObjectListFieldCollection.GetEnumerator(); while (iEnumerator.MoveNext()) { ObjectListField objectListField = (ObjectListField)iEnumerator.Current; if (objectListField.Visible) { if (objectListField.Name == "CALL") { writer.RenderText(String.Format("{0}: {1}", objectListField.Title, WmlcheckPhonenumber(item[i])), true, false); } else if (objectListField.Name == "MAIL") { writer.RenderText(String.Format("{0}: {1}", objectListField.Title, WmlMail(item[i])), true, false); } else { writer.RenderText(String.Format("{0}: {1}", objectListField.Title, item[i]), true); } } i++; } base.RenderPostBackEvent(writer, "__back", str2, true, str1, true); writer.ExitStyle(base.Style); }
private void RenderItemDetailsWithTableTags(HtmlMobileTextWriter writer, ObjectListItem item) { Style style1 = base.Style; Style style2 = Control.LabelStyle; Style style3 = Control.CommandStyle; Color color = (Color)style1[Style.ForeColorKey, true]; writer.Write("<table border=0 width=\"100%\">\r\n<tr><td colspan=2>"); writer.BeginStyleContext(); writer.EnterStyle(style2); writer.WriteText(item[Control.LabelFieldIndex], true); writer.ExitStyle(style2); writer.EndStyleContext(); writer.Write("</td></tr>\r\n<tr>"); RenderRule(writer, color, 2); IObjectListFieldCollection iObjectListFieldCollection = Control.AllFields; int i = 0; IEnumerator iEnumerator = iObjectListFieldCollection.GetEnumerator(); while (iEnumerator.MoveNext()) { ObjectListField objectListField = (ObjectListField)iEnumerator.Current; if (objectListField.Visible) { writer.Write("<tr><td>"); writer.BeginStyleContext(); writer.EnterStyle(base.Style); writer.WriteText(objectListField.Title, true); writer.ExitStyle(base.Style); writer.EndStyleContext(); writer.Write("</td><td>"); writer.BeginStyleContext(); writer.EnterStyle(style1); if (objectListField.Name == "CALL") { writer.WriteText(HtmlcheckPhonenumber(item[i]), false); } else if (objectListField.Name == "MAIL") { writer.WriteText(HtmlMail(item[i]), false); } else { writer.WriteText(item[i], false); } writer.ExitStyle(style1); writer.EndStyleContext(); writer.Write("</td></tr>\r\n"); } i++; } RenderRule(writer, color, 2); writer.Write("<tr><td colspan=2>"); writer.BeginStyleContext(); BooleanOption booleanOption = style3.Font.Italic; style3.Font.Italic = BooleanOption.False; writer.EnterStyle(style3); writer.Write("[ "); writer.ExitStyle(style3); style3.Font.Italic = booleanOption; writer.EnterStyle(style3); iEnumerator = Control.Commands.GetEnumerator(); while (iEnumerator.MoveNext()) { ObjectListCommand objectListCommand = (ObjectListCommand)iEnumerator.Current; RenderPostBackEventAsAnchor(writer, objectListCommand.Name, objectListCommand.Text, style3); writer.Write(" | "); } string str = (Control.BackCommandText != String.Empty) ? Control.BackCommandText : base.GetDefaultLabel(ControlAdapter.BackLabel); RenderPostBackEventAsAnchor(writer, BackToList, str, style3); writer.ExitStyle(style3); style3.Font.Italic = BooleanOption.False; writer.EnterStyle(style3); writer.Write(" ]"); writer.ExitStyle(style3); style3.Font.Italic = booleanOption; writer.EndStyleContext(); writer.Write("</td></tr></table>"); }
private void RenderItemDetailsWithoutTableTags(HtmlMobileTextWriter writer, ObjectListItem item) { Style style1 = base.Style; Style style2 = Control.LabelStyle; Style style3 = Control.CommandStyle; writer.EnterStyle(style2); writer.WriteText(item[Control.LabelFieldIndex], true); writer.ExitStyle(style2, true); IObjectListFieldCollection iObjectListFieldCollection = Control.AllFields; int i = 0; bool flag = style1.Font.Bold == BooleanOption.True; writer.EnterStyle(style1); IEnumerator iEnumerator = iObjectListFieldCollection.GetEnumerator(); while (iEnumerator.MoveNext()) { ObjectListField objectListField = (ObjectListField)iEnumerator.Current; if (objectListField.Visible) { if (!flag) { writer.Write("<b>"); } writer.WriteText(String.Concat(objectListField.Title, ":"), true); if (!flag) { writer.Write("</b>"); } writer.Write(" "); if (objectListField.Name == "CALL") { writer.WriteText(HtmlcheckPhonenumber(item[i]), true); } else if (objectListField.Name == "MAIL") { writer.WriteText(HtmlMail(item[i]), true); } else { writer.WriteText(item[i], true); } writer.WriteBreak(); } i++; } writer.ExitStyle(style1); BooleanOption booleanOption = style3.Font.Italic; style3.Font.Italic = BooleanOption.False; writer.EnterStyle(style3); writer.Write("[ "); writer.ExitStyle(style3); style3.Font.Italic = booleanOption; writer.EnterStyle(style3); iEnumerator = Control.Commands.GetEnumerator(); while (iEnumerator.MoveNext()) { ObjectListCommand objectListCommand = (ObjectListCommand)iEnumerator.Current; RenderPostBackEventAsAnchor(writer, objectListCommand.Name, objectListCommand.Text, style3); writer.Write(" | "); } string str = (Control.BackCommandText != String.Empty) ? Control.BackCommandText : base.GetDefaultLabel(ControlAdapter.BackLabel); RenderPostBackEventAsAnchor(writer, BackToList, str, style3); writer.ExitStyle(style3); style3.Font.Italic = BooleanOption.False; writer.EnterStyle(style3); writer.Write(" ]"); writer.ExitStyle(style3, Control.BreakAfter); style3.Font.Italic = booleanOption; }