/// <include file='doc\WmlObjectListAdapter.uex' path='docs/doc[@for="WmlObjectListAdapter.RenderItemMenu"]/*' />
        protected virtual void RenderItemMenu(WmlMobileTextWriter writer, ObjectListItem item)
        {
            bool requiresDetails = HasItemDetails();

            String detailsCommandText = Control.DetailsCommandText.Length == 0 ?
                                        SR.GetString(SR.WmlObjectListAdapterDetails) :
                                        Control.DetailsCommandText;
            String softkeyLabel = detailsCommandText.Length <= Device.MaximumSoftkeyLabelLength ?
                                  detailsCommandText :
                                  null;
            Style commandStyle = Control.CommandStyle;

            if (commandStyle.Alignment == Alignment.NotSet)
            {
                commandStyle.Alignment = Alignment.Left;
            }
            writer.EnterStyle(commandStyle);
            if (requiresDetails)
            {
                RenderPostBackEvent(writer, _showDetails,
                                    softkeyLabel, true, detailsCommandText, true, WmlPostFieldType.Raw);
            }

            ObjectListCommandCollection commands = Control.Commands;

            foreach (ObjectListCommand command in commands)
            {
                RenderPostBackEvent(writer, command.Name,
                                    GetDefaultLabel(GoLabel), false, command.Text, true, WmlPostFieldType.Raw);
            }
            writer.ExitStyle(commandStyle);
        }
Example #2
0
 protected virtual void RenderForm(WmlMobileTextWriter writer, Form form)
 {
     writer.AnalyzeMode = true;
     form.RenderControl(writer);
     writer.AnalyzeMode = false;
     form.RenderControl(writer);
 }
Example #3
0
        public override void Render(WmlMobileTextWriter writer)
        {
            writer.EnterLayout(Style);

            int beginElement = Control.FirstVisibleElementIndex;
            int beginOffset  = Control.FirstVisibleElementOffset;
            int endElement   = Control.LastVisibleElementIndex;
            int endOffset    = Control.LastVisibleElementOffset;

            for (int i = beginElement; i <= endElement; i++)
            {
                int begin = (i == beginElement) ? beginOffset : 0;
                int end;
                if (i == endElement)
                {
                    if (endOffset <= begin)
                    {
                        break;
                    }
                    end = endOffset;
                }
                else
                {
                    end = -1;
                }

                RenderElement(writer, i, begin, end);
            }

            writer.RenderText("", true);
            writer.ExitLayout(Style);
        }
        /// <include file='doc\WmlTextViewAdapter.uex' path='docs/doc[@for="WmlTextViewAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            writer.EnterLayout(Style);

            int beginElement = Control.FirstVisibleElementIndex;
            int beginOffset = Control.FirstVisibleElementOffset;
            int endElement = Control.LastVisibleElementIndex;
            int endOffset = Control.LastVisibleElementOffset;

            for (int i = beginElement; i <= endElement; i++)
            {
                int begin = (i == beginElement) ? beginOffset : 0;
                int end;
                if (i == endElement)
                {
                    if (endOffset <= begin)
                    {
                        break;
                    }
                    end = endOffset;
                }
                else
                {
                    end = -1;
                }

                RenderElement(writer, i, begin, end);
            }

            writer.RenderText(String.Empty, true);
            writer.ExitLayout(Style);
        }
        /// <include file='doc\WmlObjectListAdapter.uex' path='docs/doc[@for="WmlObjectListAdapter.RenderItemDetails"]/*' />
        protected virtual void RenderItemDetails(WmlMobileTextWriter writer, ObjectListItem item)
        {
            String backCommandText = Control.BackCommandText.Length == 0 ?
                                     GetDefaultLabel(BackLabel) :
                                     Control.BackCommandText;
            String softkeyLabel = backCommandText.Length <= Device.MaximumSoftkeyLabelLength ?
                                  backCommandText :
                                  null;

            Style labelStyle = Control.LabelStyle;

            writer.EnterStyle(labelStyle);
            writer.RenderText(item[Control.LabelFieldIndex], true);
            writer.ExitStyle(labelStyle);

            writer.EnterStyle(Style);
            IObjectListFieldCollection fields = Control.AllFields;
            int fieldIndex = 0;

            foreach (ObjectListField field in fields)
            {
                if (field.Visible)
                {
                    String displayText = String.Format(CultureInfo.InvariantCulture, "{0}: {1}", field.Title, item[fieldIndex]);
                    writer.RenderText(displayText, true);
                }
                fieldIndex++;
            }
            RenderPostBackEvent(writer, _backToList, softkeyLabel, true, backCommandText, true);
            writer.ExitStyle(Style);
        }
        /// <include file='doc\WmlObjectListAdapter.uex' path='docs/doc[@for="WmlObjectListAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            switch (Control.ViewMode)
            {
            case ObjectListViewMode.List:
                if (Control.HasControls())
                {
                    writer.BeginCustomMarkup();
                    RenderChildren(writer);
                    writer.EndCustomMarkup();
                    return;
                }
                RenderItemsList(writer);
                break;

            case ObjectListViewMode.Commands:
                RenderItemMenu(writer, Control.Selection);
                break;

            case ObjectListViewMode.Details:
                if (Control.Selection.HasControls())
                {
                    writer.BeginCustomMarkup();
                    Control.Selection.RenderChildren(writer);
                    writer.EndCustomMarkup();
                    return;
                }
                RenderItemDetails(writer, Control.Selection);
                break;
            }
        }
Example #7
0
 /// <include file='doc\WmlControlAdapter.uex' path='docs/doc[@for="WmlControlAdapter.RenderSubmitEvent"]/*' />
 protected void RenderSubmitEvent(
     WmlMobileTextWriter writer,
     String softkeyLabel,
     String text,
     bool breakAfter)
 {
     RenderPostBackEvent(writer, null, softkeyLabel, true,
                         text, breakAfter, WmlPostFieldType.Submit);
 }
 // A helper function to do the common code for DataBind and
 // RenderChildren.
 private void DataBindAndRender(WmlMobileTextWriter writer,
                                List list,
                                ArrayList arr)
 {
     list.DataSource = arr;
     list.DataBind();
     list.Visible = true;
     list.RenderControl(writer);
 }
        public override void Render(WmlMobileTextWriter writer)
        {
            String source               = Control.ImageUrl;
            String target               = Control.NavigateUrl;
            String text                 = Control.AlternateText;
            bool   breakAfterContents   = Control.BreakAfter;
            String softkeyLabel         = Control.SoftkeyLabel;
            bool   implicitSoftkeyLabel = false;

            if (softkeyLabel.Length == 0)
            {
                implicitSoftkeyLabel = true;
                softkeyLabel         = text;
            }

            writer.EnterLayout(Style);
            if (target != String.Empty)
            {
                RenderBeginLink(writer, target, softkeyLabel, implicitSoftkeyLabel, true);
                breakAfterContents = false;
            }

            if (source == String.Empty)
            {
                // Just write the alternate as text
                writer.RenderText(text, breakAfterContents);
            }
            else
            {
                String localSource;

                if (source.StartsWith(Constants.SymbolProtocol))
                {
                    // src is required according to WML
                    localSource = source.Substring(Constants.SymbolProtocol.Length);
                    source      = String.Empty;
                }
                else
                {
                    localSource = null;

                    // AUI 3652
                    source = Control.ResolveUrl(source);

                    writer.AddResource(source);
                }

                writer.RenderImage(source, localSource, text, breakAfterContents);
            }

            if (target != String.Empty)
            {
                RenderEndLink(writer, target, Control.BreakAfter);
            }
            writer.ExitLayout(Style);
        }
        /// <include file='doc\WmlImageAdapter.uex' path='docs/doc[@for="WmlImageAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            String source = Control.ImageUrl;
            String target = Control.NavigateUrl;
            String text   = Control.AlternateText;
            bool   breakAfterContents = Control.BreakAfter;
            String softkeyLabel = Control.SoftkeyLabel;
            bool implicitSoftkeyLabel = false;
            if (softkeyLabel.Length == 0)
            {
                implicitSoftkeyLabel = true;
                softkeyLabel = text;
            }

            writer.EnterLayout(Style);
            if (!String.IsNullOrEmpty(target))
            {
                RenderBeginLink(writer, target, softkeyLabel, implicitSoftkeyLabel, true);
                breakAfterContents = false;
            }

            if (String.IsNullOrEmpty(source))
            {
                // Just write the alternate as text
                writer.RenderText(text, breakAfterContents);
            }
            else
            {
                String localSource;

                if (source.StartsWith(Constants.SymbolProtocol, StringComparison.Ordinal))
                {
                    // src is required according to WML
                    localSource = source.Substring(Constants.SymbolProtocol.Length);
                    source = String.Empty;
                }
                else
                {
                    localSource = null;

                    // AUI 3652
                    source = Control.ResolveUrl(source);

                    writer.AddResource(source);
                }

                writer.RenderImage(source, localSource, text, breakAfterContents);
            }

            if (!String.IsNullOrEmpty(target))
            {
                RenderEndLink(writer, target, Control.BreakAfter);
            }
            writer.ExitLayout(Style);
        }
 /// <include file='doc\WmlLiteralTextAdapter.uex' path='docs/doc[@for="WmlLiteralTextAdapter.Render"]/*' />
 public override void Render(WmlMobileTextWriter writer)
 {
     // Cache value, because Render is called twice.
     if (_pagedText == null)
     {
         _pagedText = Control.PagedText;
     }
     writer.EnterFormat(Style);
     writer.RenderText(_pagedText, Control.BreakAfter);
     writer.ExitFormat(Style);
 }
 /// <include file='doc\WmlLiteralTextAdapter.uex' path='docs/doc[@for="WmlLiteralTextAdapter.Render"]/*' />
 public override void Render(WmlMobileTextWriter writer)
 {
     // Cache value, because Render is called twice.
     if (_pagedText == null)
     {
         _pagedText = Control.PagedText;
     }
     writer.EnterFormat(Style);
     writer.RenderText(_pagedText, Control.BreakAfter);
     writer.ExitFormat(Style);
 }
Example #13
0
 /// <include file='doc\WmlControlAdapter.uex' path='docs/doc[@for="WmlControlAdapter.RenderPostBackEvent"]/*' />
 protected void RenderPostBackEvent(
     WmlMobileTextWriter writer,
     String argument,
     String softkeyLabel,
     bool mapToSoftkey,
     String text,
     bool breakAfter)
 {
     RenderPostBackEvent(writer, argument, softkeyLabel, mapToSoftkey,
                         text, breakAfter, WmlPostFieldType.Normal);
 }
Example #14
0
 protected internal virtual void RenderCardTag(WmlMobileTextWriter writer, IDictionary attributes)
 {
     writer.WriteBeginTag("card");
     if (attributes != null)
     {
         foreach (DictionaryEntry entry in attributes)
         {
             writer.WriteAttribute((String)entry.Key, (String)entry.Value, true);
         }
     }
     writer.WriteLine(">");
 }
Example #15
0
 /// <include file='doc\WmlControlAdapter.uex' path='docs/doc[@for="WmlControlAdapter.RenderLink"]/*' />
 protected void RenderLink(WmlMobileTextWriter writer,
                           String targetUrl,
                           String softkeyLabel,
                           bool implicitSoftkeyLabel,
                           bool mapToSoftkey,
                           String text,
                           bool breakAfter)
 {
     RenderBeginLink(writer, targetUrl, softkeyLabel, implicitSoftkeyLabel, mapToSoftkey);
     writer.RenderText(text);
     RenderEndLink(writer, targetUrl, breakAfter);
 }
Example #16
0
        /// <include file='doc\WmlControlAdapter.uex' path='docs/doc[@for="WmlControlAdapter.RenderEndLink"]/*' />
        protected void RenderEndLink(WmlMobileTextWriter writer, String targetUrl, bool breakAfter)
        {
            String postback = DeterminePostBack(targetUrl);

            if (postback != null)
            {
                writer.RenderEndPostBack(Control.UniqueID, postback, WmlPostFieldType.Normal, false, breakAfter);
            }
            else
            {
                writer.RenderEndHyperlink(breakAfter);
            }
        }
        public override void Render(WmlMobileTextWriter writer)
        {
            MobileListItemCollection items = Control.Items;
            int count = items.Count;

            if (count == 0)
            {
                return;
            }

            writer.EnterLayout(Style);
            bool crossPagePost = Control.Form.Action != String.Empty;

            if (crossPagePost)
            {
                if (_ivalue != null)
                {
                    String formVariable = ClientPrefix + Control.ClientID;
                    writer.AddFormVariable(formVariable, _ivalue, false);
                    // does not render _ivalue if null or form variables written.
                    writer.RenderBeginSelect(Control.ClientID, formVariable, _ivalue, Control.Title, Control.IsMultiSelect);
                }
                else // _ivalue == null
                {
                    writer.RenderBeginSelect(Control.ClientID, null, null, Control.Title, Control.IsMultiSelect);
                }
            }
            else // !crossPagePost
            {
                if (_ivalue != null)
                {
                    writer.AddFormVariable(Control.ClientID, _ivalue, false);
                }
                // does not render _ivalue if null or form variables written.
                writer.RenderBeginSelect(null, Control.ClientID, _ivalue, Control.Title, Control.IsMultiSelect);
            }

            foreach (MobileListItem item in items)
            {
                if (crossPagePost)
                {
                    writer.RenderSelectOption(item.Text, item.Value);
                }
                else
                {
                    writer.RenderSelectOption(item.Text);
                }
            }
            writer.RenderEndSelect(Control.BreakAfter);
            writer.ExitLayout(Style);
        }
 /// <include file='doc\WmlPanelAdapter.uex' path='docs/doc[@for="WmlPanelAdapter.Render"]/*' />
 public override void Render(WmlMobileTextWriter writer)
 {
     if (Control.Content != null)
     {
         writer.BeginCustomMarkup();
         Control.Content.RenderControl(writer);
         writer.EndCustomMarkup();
     }
     else
     {
         writer.EnterLayout(Style);
         RenderChildren(writer);
         writer.ExitLayout(Style, Control.BreakAfter);
     }
 }
 public override void Render(WmlMobileTextWriter writer)
 {
     if (Control.Content != null)
     {
         writer.BeginCustomMarkup();
         Control.Content.RenderControl(writer);
         writer.EndCustomMarkup();
     }
     else
     {
         writer.EnterLayout(Style);
         RenderChildren(writer);
         writer.ExitLayout(Style, Control.BreakAfter);
     }
 }
        public override void Render(WmlMobileTextWriter writer)
        {
            string Format;

            if (Control.Numeric)
            {
                Format = "*N"; //Set format to any number of numeric characters
            }
            else
            {
                Format = "*M"; //Set format to any number of characters
            }
            writer.RenderTextBox(Control.UniqueID, Control.Text, Format, Control.Title,
                                 Control.Password, Control.Size, Control.MaxLength, false, Control.BreakAfter);
        }
Example #21
0
        /// <include file='doc\WmlListAdapter.uex' path='docs/doc[@for="WmlListAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            if (Control.HasControls())
            {
                writer.BeginCustomMarkup();
                RenderChildren(writer);
                writer.EndCustomMarkup();
                return;
            }

            int pageStart = Control.FirstVisibleItemIndex;
            int pageSize  = Control.VisibleItemCount;

            if (pageSize == 0)
            {
                return;
            }

            MobileListItemCollection items = Control.Items;

            if (items.Count == 0)
            {
                return;
            }

            bool itemsAsLinks  = Control.ItemsAsLinks;
            bool hasCmdHandler = Control.HasItemCommandHandler;

            writer.EnterStyle(Style);
            for (int i = 0; i < pageSize; i++)
            {
                MobileListItem item = items[pageStart + i];

                if (itemsAsLinks)
                {
                    RenderLink(writer, item.Value, null, false, false, item.Text, true);
                }
                else if (hasCmdHandler)
                {
                    RenderPostBackEvent(writer, item.Index.ToString(CultureInfo.InvariantCulture), null, true, item.Text, true);
                }
                else
                {
                    writer.RenderText(item.Text, true);
                }
            }
            writer.ExitStyle(Style);
        }
        public override void Render(WmlMobileTextWriter writer)
        {
            String value            = Control.Text;
            bool   requiresRandomID = RequiresRandomID();

            writer.EnterLayout(Style);
            if (Control.Password)
            {
                value = String.Empty;
            }

            if (!PageAdapter.RequiresValueAttributeInInputTag())
            {
                writer.AddFormVariable(Control.ClientID, value, requiresRandomID);
            }
            else
            {
                // This is to make sure an id is determined in the first
                // pass, and this is done in AddFormVariable as well.
                writer.MapClientIDToShortName(Control.ClientID, requiresRandomID);
            }

            String format = ((IAttributeAccessor)Control).GetAttribute("wmlFormat");

            if (format == null || format == String.Empty)
            {
                if (Control.Numeric)
                {
                    format = "*N";
                }
                else
                {
                    format = null;
                }
            }

            writer.RenderTextBox(Control.ClientID,
                                 value,
                                 format,
                                 Control.Title,
                                 Control.Password,
                                 Control.Size,
                                 Control.MaxLength,
                                 requiresRandomID,
                                 Control.BreakAfter);
            writer.ExitLayout(Style);
        }
        /// <include file='doc\WmlTextBoxAdapter.uex' path='docs/doc[@for="WmlTextBoxAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            String value = Control.Text;
            bool requiresRandomID = RequiresRandomID();

            writer.EnterLayout(Style);
            if (Control.Password)
            {
                value = String.Empty;
            }

            if (!PageAdapter.RequiresValueAttributeInInputTag())
            {
                writer.AddFormVariable(Control.ClientID, value, requiresRandomID);
            }
            else
            {
                // This is to make sure an id is determined in the first
                // pass, and this is done in AddFormVariable as well.
                writer.MapClientIDToShortName(Control.ClientID, requiresRandomID);
            }

            String format = ((IAttributeAccessor)Control).GetAttribute("wmlFormat");
            if (String.IsNullOrEmpty(format))
            {
                if (Control.Numeric)
                {
                    format = "*N";
                }
                else
                {
                    format = null;
                }
            }
            
            writer.RenderTextBox(Control.ClientID, 
                                 value,
                                 format, 
                                 Control.Title,
                                 Control.Password, 
                                 Control.Size, 
                                 Control.MaxLength, 
                                 requiresRandomID,
                                 Control.BreakAfter);
            writer.ExitLayout(Style);
        }
        /// <include file='doc\WmlLinkAdapter.uex' path='docs/doc[@for="WmlLinkAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            String navigateUrl = Control.NavigateUrl;
            String text = (String.IsNullOrEmpty(Control.Text)) ? navigateUrl : Control.Text;
            bool breakAfter = Control.BreakAfter && !Device.RendersBreaksAfterWmlAnchor;
            String softkeyLabel = Control.SoftkeyLabel;
            bool implicitSoftkeyLabel = false;
            if (softkeyLabel.Length == 0)
            {
                implicitSoftkeyLabel = true;
                softkeyLabel = Control.Text;
            }

            writer.EnterStyle(Style);
            RenderLink(writer, navigateUrl, softkeyLabel, implicitSoftkeyLabel, true, text, breakAfter);
            writer.ExitStyle(Style);
        }
Example #25
0
        public override void Render(WmlMobileTextWriter writer)
        {
            if (RequiresUTF8ContentEncoding())
            {
                Page.Response.ContentEncoding = UTF8Encoding;
            }

            writer.BeginResponse();
            writer.BeginFile(Page.Request.Url.ToString(), _contentType, Page.Response.Charset);

            RenderXmlHeader(writer);

            writer.WriteFullBeginTag("wml");

            if (Device.SupportsCacheControlMetaTag)
            {
                writer.Write(_cacheExpiry);
            }
            else
            {
                Page.Response.AppendHeader("Cache-Control", "max-age=0");
            }

            if (Device.CanCombineFormsInDeck)
            {
                _renderableForms = Page.ActiveForm.GetLinkedForms(OptimumPageWeight);
                Debug.Assert(_renderableForms != null, "_renderableForms is null");
            }
            else
            {
                _renderableForms = new ArrayList();
                _renderableForms.Add(Page.ActiveForm);
            }

            foreach (Form form in _renderableForms)
            {
                RenderForm(writer, form);
            }

            writer.RenderExtraCards();

            writer.WriteEndTag("wml");

            writer.EndFile();
            writer.EndResponse();
        }
        /// <include file='doc\WmlListAdapter.uex' path='docs/doc[@for="WmlListAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            if(Control.HasControls())
            {
                writer.BeginCustomMarkup();
                RenderChildren(writer);
                writer.EndCustomMarkup();
                return;
            }

            int pageStart = Control.FirstVisibleItemIndex;
            int pageSize = Control.VisibleItemCount;
            if (pageSize == 0)
            {
                return;
            }

            MobileListItemCollection items = Control.Items;
            if (items.Count == 0)
            {
                return;
            }

            bool itemsAsLinks = Control.ItemsAsLinks;
            bool hasCmdHandler = Control.HasItemCommandHandler;

            writer.EnterStyle(Style);
            for (int i = 0; i < pageSize; i++)
            {                        
                MobileListItem item = items[pageStart + i];

                if (itemsAsLinks)
                {
                    RenderLink(writer, item.Value, null, false, false, item.Text, true);
                }
                else if (hasCmdHandler)
                {
                    RenderPostBackEvent(writer, item.Index.ToString(CultureInfo.InvariantCulture), null, true, item.Text, true); 
                }
                else
                {
                    writer.RenderText(item.Text, true);
                }
            }
            writer.ExitStyle(Style);
        }
Example #27
0
        /// <include file='doc\WmlValidatorAdapter.uex' path='docs/doc[@for="WmlValidatorAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            writer.EnterStyle(Style);
            if (!Control.IsValid && Control.Display != ValidatorDisplay.None)
            {
                String text = Control.Text;
                if (String.IsNullOrEmpty(text))
                {
                    text = Control.ErrorMessage;
                }

                if (!String.IsNullOrEmpty(text))
                {
                    writer.RenderText(text, Control.BreakAfter);
                }
            }
            writer.ExitStyle(Style);
        }
 /// <include file='doc\WmlValidatorAdapter.uex' path='docs/doc[@for="WmlValidatorAdapter.Render"]/*' />
 public override void Render(WmlMobileTextWriter writer)
 {
     writer.EnterStyle(Style);
     if (!Control.IsValid && Control.Display != ValidatorDisplay.None)
     {
         String text = Control.Text;
         if (String.IsNullOrEmpty(text))
         {
             text = Control.ErrorMessage;
         }
         
         if (!String.IsNullOrEmpty(text))
         {
             writer.RenderText(text, Control.BreakAfter);
         }
     }
     writer.ExitStyle(Style);
 }
        public override void Render(WmlMobileTextWriter writer)
        {
            String targetUrl            = Control.NavigateUrl;
            String text                 = (Control.Text == String.Empty) ? targetUrl : Control.Text;
            bool   breakAfter           = Control.BreakAfter && !Device.RendersBreaksAfterWmlAnchor;
            String softkeyLabel         = Control.SoftkeyLabel;
            bool   implicitSoftkeyLabel = false;

            if (softkeyLabel.Length == 0)
            {
                implicitSoftkeyLabel = true;
                softkeyLabel         = Control.Text;
            }

            writer.EnterStyle(Style);
            RenderLink(writer, targetUrl, softkeyLabel, implicitSoftkeyLabel, true, text, breakAfter);
            writer.ExitStyle(Style);
        }
        /// <include file='doc\WmlValidationSummaryAdapter.uex' path='docs/doc[@for="WmlValidationSummaryAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            String[] errorMessages = null;

            if (Control.Visible)
            {
                errorMessages = Control.GetErrorMessages();
            }
    
            writer.EnterStyle(Style);
            if (errorMessages != null)
            {
                if (Control.HeaderText.Length > 0)
                {
                    writer.RenderText(Control.HeaderText, true);
                }

                ArrayList arr = new ArrayList();
                foreach (String errorMessage in errorMessages)
                {
                    Debug.Assert(errorMessage != null && errorMessage.Length > 0, "Bad Error Messages");
                    arr.Add(errorMessage);
                }

                _list.DataSource = arr;
                _list.DataBind();

                if (String.Compare(Control.FormToValidate, Control.Form.UniqueID, StringComparison.OrdinalIgnoreCase) != 0)
                {
                    _link.NavigateUrl = Constants.FormIDPrefix + Control.FormToValidate;
                    _link.Text = Control.BackLabel.Length == 0 ? GetDefaultLabel(BackLabel) : Control.BackLabel;
                }
                else
                {
                    _link.Visible = false;
                }

                // Render the child controls to display error message list and a
                // link for going back to the Form that is having error
                RenderChildren(writer);
            }
            writer.ExitStyle(Style);
        }
Example #31
0
        public override void Render(WmlMobileTextWriter writer)
        {
            String[] errorMessages = null;

            if (Control.Visible)
            {
                errorMessages = Control.GetErrorMessages();
            }

            writer.EnterStyle(Style);
            if (errorMessages != null)
            {
                if (Control.HeaderText.Length > 0)
                {
                    writer.RenderText(Control.HeaderText, true);
                }

                ArrayList arr = new ArrayList();
                foreach (String errorMessage in errorMessages)
                {
                    Debug.Assert(errorMessage != null && errorMessage.Length > 0, "Bad Error Messages");
                    arr.Add(errorMessage);
                }

                _list.DataSource = arr;
                _list.DataBind();

                if (String.Compare(Control.FormToValidate, Control.Form.UniqueID, true) != 0)
                {
                    _link.NavigateUrl = Constants.FormIDPrefix + Control.FormToValidate;
                    _link.Text        = Control.BackLabel == String.Empty? GetDefaultLabel(BackLabel) : Control.BackLabel;
                }
                else
                {
                    _link.Visible = false;
                }

                // Render the child controls to display error message list and a
                // link for going back to the Form that is having error
                RenderChildren(writer);
            }
            writer.ExitStyle(Style);
        }
Example #32
0
        private void RenderElement(WmlMobileTextWriter writer, int index, int begin, int end)
        {
            TextViewElement element = Control.GetElement(index);

            if (end == -1)
            {
                end = element.Text.Length;
            }

            String text = element.Text;

            if (begin > 0 || end < text.Length)
            {
                text = text.Substring(begin, end - begin);
            }

            BooleanOption previousBold   = Style.Font.Bold;
            BooleanOption previousItalic = Style.Font.Italic;

            if (element.IsBold)
            {
                Style.Font.Bold = BooleanOption.True;
            }
            if (element.IsItalic)
            {
                Style.Font.Italic = BooleanOption.True;
            }

            writer.EnterStyle(Style);
            if (element.Url != null)
            {
                RenderLink(writer, element.Url, null, true, true, text, element.BreakAfter);
            }
            else
            {
                writer.RenderText(text, element.BreakAfter);
            }
            writer.ExitStyle(Style);

            Style.Font.Bold   = previousBold;
            Style.Font.Italic = previousItalic;
        }
        private void RenderElement(WmlMobileTextWriter writer, int index, int begin, int end)
        {
            TextViewElement element = Control.GetElement(index);
            if (end == -1)
            {
                end = element.Text.Length;
            }

            String text = element.Text;
            if (begin > 0 || end < text.Length)
            {
                text = text.Substring(begin, end - begin);
            }

            BooleanOption previousBold   = Style.Font.Bold;
            BooleanOption previousItalic = Style.Font.Italic;
            if (element.IsBold)
            {
                Style.Font.Bold = BooleanOption.True;
            }
            if (element.IsItalic)
            {
                Style.Font.Italic = BooleanOption.True;
            }
            
            writer.EnterStyle(Style);
            if (element.Url != null)
            {
                RenderLink(writer, element.Url, null, true, true, text, element.BreakAfter);
            }
            else
            {
                writer.RenderText(text, element.BreakAfter);
            }
            writer.ExitStyle(Style);

            Style.Font.Bold   = previousBold;
            Style.Font.Italic = previousItalic;
        }
Example #34
0
        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);
        }
Example #35
0
        /// <include file='doc\WmlControlAdapter.uex' path='docs/doc[@for="WmlControlAdapter.RenderPostBackEvent1"]/*' />
        protected void RenderPostBackEvent(
            WmlMobileTextWriter writer,
            String argument,
            String softkeyLabel,
            bool mapToSoftkey,
            String text,
            bool breakAfter,
            WmlPostFieldType postBackType)
        {
            bool implicitSoftkeyLabel = false;

            if (mapToSoftkey)
            {
                if (softkeyLabel == null || softkeyLabel.Length == 0)
                {
                    softkeyLabel         = text;
                    implicitSoftkeyLabel = true;
                }

                if (!writer.IsValidSoftkeyLabel(softkeyLabel))
                {
                    // If softkey label was specified explicitly, then truncate.
                    if (!implicitSoftkeyLabel && softkeyLabel.Length > 0)
                    {
                        softkeyLabel = softkeyLabel.Substring(0, Device.MaximumSoftkeyLabelLength);
                    }
                    else
                    {
                        softkeyLabel         = GetDefaultLabel(GoLabel);
                        implicitSoftkeyLabel = true;
                    }
                }
            }

            writer.RenderBeginPostBack(softkeyLabel, implicitSoftkeyLabel, mapToSoftkey);
            writer.RenderText(text);
            writer.RenderEndPostBack(Control.UniqueID, argument, postBackType, true, breakAfter);
        }
Example #36
0
        protected virtual void RenderPager(WmlMobileTextWriter writer)
        {
            PagerStyle pagerStyle = Control.PagerStyle;
            int        pageCount  = Control.PageCount;

            if (pageCount <= 1)
            {
                return;
            }
            int page = Control.CurrentPage;

            writer.EnterStyle(pagerStyle);
            if (page < pageCount)
            {
                String nextPageText = pagerStyle.GetNextPageText(page);
                RenderPostBackEvent(writer,
                                    (page + 1).ToString(),
                                    writer.IsValidSoftkeyLabel(nextPageText) ? nextPageText
                                                                             : GetDefaultLabel(NextLabel),
                                    true,
                                    nextPageText,
                                    true);
            }

            if (page > 1)
            {
                String prevPageText = pagerStyle.GetPreviousPageText(page);
                RenderPostBackEvent(writer,
                                    (page - 1).ToString(),
                                    writer.IsValidSoftkeyLabel(prevPageText) ? prevPageText
                                                                             : GetDefaultLabel(PreviousLabel),
                                    true,
                                    prevPageText,
                                    true);
            }
            writer.ExitStyle(pagerStyle);
        }
Example #37
0
        protected internal virtual void RenderExtraCardElements(WmlMobileTextWriter writer)
        {
            Form form = this.Control as Form;

            if ((form != null) && (form.Script != null))
            {
                foreach (Control childControl in form.Script.Controls)
                {
                    LiteralControl lc = childControl as LiteralControl;
                    if (lc != null)
                    {
                        writer.Write(lc.Text);
                    }
                    else
                    {
                        DataBoundLiteralControl dlc = childControl as DataBoundLiteralControl;
                        if (dlc != null)
                        {
                            writer.Write(dlc.Text);
                        }
                    }
                }
            }
        }
        public override void Render(WmlMobileTextWriter writer)
        {
            Style st = new Style();
            st.Wrapping = (Wrapping) Style[Style.WrappingKey, true];
            st.Alignment = (Alignment) Style[Style.AlignmentKey, true];
            writer.EnterLayout(st);
            if (_menu.Visible)
            {
                _menu.RenderControl(writer);
            }
            else
            {
                ((Control) Control.ActivePane).RenderControl(writer);
            }

            writer.ExitLayout(st);
        }
        /// <include file='doc\WmlSelectionListAdapter.uex' path='docs/doc[@for="WmlSelectionListAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            MobileListItemCollection items = Control.Items;
            int count = items.Count;
            if (count == 0)
            {
                return;
            }           

            writer.EnterLayout(Style);
            bool crossPagePost = !String.IsNullOrEmpty(Control.Form.Action);

            if (crossPagePost)
            {
                if (_ivalue != null)
                {
                    String formVariable = ClientPrefix + Control.ClientID;
                    writer.AddFormVariable (formVariable, _ivalue, false);
                    // does not render _ivalue if null or form variables written.
                    writer.RenderBeginSelect(Control.ClientID, formVariable, _ivalue, Control.Title, Control.IsMultiSelect);
                }
                else // _ivalue == null
                {
                    writer.RenderBeginSelect(Control.ClientID, null, null, Control.Title, Control.IsMultiSelect);
                }
            }
            else // !crossPagePost
            {
                if (_ivalue != null)
                {
                    writer.AddFormVariable (Control.ClientID, _ivalue, false);
                }
                // does not render _ivalue if null or form variables written.
                writer.RenderBeginSelect(null, Control.ClientID, _ivalue, Control.Title, Control.IsMultiSelect);            
            }

            foreach (MobileListItem item in items)
            {
                if (crossPagePost)
                {
                    writer.RenderSelectOption(item.Text, item.Value);
                }
                else
                {
                    writer.RenderSelectOption(item.Text);
                }
            }
            writer.RenderEndSelect(Control.BreakAfter);
            writer.ExitLayout(Style);
        }
 // Methods
 public virtual void Render(WmlMobileTextWriter writer)
 {
 }
        /// <include file='doc\WmlPhoneCallAdapter.uex' path='docs/doc[@for="WmlPhoneCallAdapter.Render"]/*' />
        public override void Render(WmlMobileTextWriter writer)
        {
            String text, url, phoneNumber;
            String controlText = Control.Text;

            // Always strip off optional separators for PhoneNumber before it
            // is added in markup.

            String originalNumber = Control.PhoneNumber;
            char[] plainNumber = new char[originalNumber.Length];  // allocate enough buffer size

            // Loop to strip out optional separators
            int sizeOfPlainNumber = 0;
            foreach (char ch in originalNumber)
            {
                if ((ch >= '0' && ch <= '9') || ch == '+')
                {
                    plainNumber[sizeOfPlainNumber] = ch;
                    sizeOfPlainNumber++;
                }
            }

            // Assign the number string with the right size
            phoneNumber = new String(plainNumber, 0, sizeOfPlainNumber);

            // Construct text and url based on device capabilities
            //
            if (!Device.CanInitiateVoiceCall)
            {
                text = String.Format(CultureInfo.InvariantCulture, Control.AlternateFormat,
                                     controlText,
                                     originalNumber);
                url = Control.AlternateUrl;
            }
            else
            {
                // Some WML browsers require the phone number
                // showing as text so it can be selected.  If it is not
                // formatted in the text yet, append it to the end of the
                // text.
                if(Device.RequiresPhoneNumbersAsPlainText)
                {
                    text = controlText + " " + phoneNumber;
                    url = String.Empty;
                }
                else
                {
                    text = (controlText == null || controlText.Length > 0) ?
                                controlText : originalNumber;
                    url = "wtai://wp/mc;" + phoneNumber;
                }
            }

            // Write out plain text or corresponding link/softkey command
            // accordingly
            //
            writer.EnterStyle(Style);
            if (url.Length == 0)
            {
                writer.RenderText(text, Control.BreakAfter);
            }
            else
            {
                String softkeyLabel = Control.SoftkeyLabel;
                bool implicitSoftkeyLabel = false;
                if (softkeyLabel.Length == 0)
                {
                    implicitSoftkeyLabel = true;
                    softkeyLabel = text;
                }
                if (!writer.IsValidSoftkeyLabel(softkeyLabel))
                {
                    if (!implicitSoftkeyLabel && softkeyLabel.Length > 0)
                    {
                        softkeyLabel = softkeyLabel.Substring(0, Device.MaximumSoftkeyLabelLength);
                    }
                    else
                    {
                        implicitSoftkeyLabel = true;
                        softkeyLabel = GetDefaultLabel(CallLabel);
                    }
                }
                RenderBeginLink(writer, url, softkeyLabel, implicitSoftkeyLabel, true);
                writer.RenderText(text);
                RenderEndLink(writer, url, Control.BreakAfter);
            }
            writer.ExitStyle(Style);
        }
 /// <include file='doc\WmlLabelAdapter.uex' path='docs/doc[@for="WmlLabelAdapter.Render"]/*' />
 public override void Render(WmlMobileTextWriter writer)
 {
     writer.EnterStyle(Style);
     writer.RenderText(Control.Text, Control.BreakAfter);
     writer.ExitStyle(Style);
 }
 /// <include file='doc\WmlCommandAdapter.uex' path='docs/doc[@for="WmlCommandAdapter.Render"]/*' />
 public override void Render(WmlMobileTextWriter writer)
 {
     writer.EnterStyle(Style);
     RenderSubmitEvent(writer, Control.SoftkeyLabel, Control.Text, Control.BreakAfter);
     writer.ExitStyle(Style);
 }
        /// <include file='doc\WmlObjectListAdapter.uex' path='docs/doc[@for="WmlObjectListAdapter.RenderItemsList"]/*' />
        protected virtual void RenderItemsList(WmlMobileTextWriter writer)
        {
            bool rendersAcceptsInline      = Device.RendersWmlDoAcceptsInline;
            bool rendersSelectsAsMenuCards = Device.RendersWmlSelectsAsMenuCards;
            bool rendersBreaksAfterAnchor  = Device.RendersBreaksAfterWmlAnchor;
            int  pageStart = Control.FirstVisibleItemIndex;
            int  pageSize  = Control.VisibleItemCount;
            ObjectListItemCollection items = Control.Items;

            if (pageSize == 0 || items.Count == 0)
            {
                return;
            }

            bool hasDefaultCommand     = HasDefaultCommand();
            bool onlyHasDefaultCommand = OnlyHasDefaultCommand();
            bool requiresSecondScreen  = HasItemDetails() || (!onlyHasDefaultCommand && HasCommands());
            bool itemRequiresHyperlink = requiresSecondScreen || hasDefaultCommand;

            writer.EnterLayout(Style);

            int[] tableFieldIndices = null;
            if (ShouldRenderAsTable() && (tableFieldIndices = Control.TableFieldIndices).Length != 0)
            {
                writer.BeginCustomMarkup();
                int fieldCount = tableFieldIndices.Length;
                writer.Write("<table columns=\"");
                writer.Write(fieldCount.ToString(CultureInfo.InvariantCulture));
                writer.WriteLine("\">");

                if (ShouldRenderTableHeaders())
                {
                    writer.Write("<tr>");
                    foreach (int fieldIndex in tableFieldIndices)
                    {
                        writer.Write("<td>");
                        writer.RenderText(Control.AllFields[fieldIndex].Title);
                        writer.Write("</td>");
                    }
                    writer.WriteLine("</tr>");
                }

                for (int i = 0; i < pageSize; i++)
                {
                    ObjectListItem item = items[pageStart + i];
                    writer.Write("<tr>");
                    for (int field = 0; field < fieldCount; field++)
                    {
                        writer.Write("<td>");
                        if (field == 0 && itemRequiresHyperlink)
                        {
                            RenderPostBackEvent(writer,
                                                requiresSecondScreen ?
                                                String.Format(CultureInfo.InvariantCulture, _showMoreFormatAnchor, item.Index) :
                                                item.Index.ToString(CultureInfo.InvariantCulture),
                                                GetDefaultLabel(GoLabel),
                                                false,
                                                item[tableFieldIndices[0]],
                                                false,
                                                WmlPostFieldType.Raw);
                        }
                        else
                        {
                            writer.RenderText(item[tableFieldIndices[field]]);
                        }
                        writer.Write("</td>");
                    }
                    writer.WriteLine("</tr>");
                }
                writer.WriteLine("</table>");
                writer.EndCustomMarkup();
            }
            else
            {
                int             labelFieldIndex = Control.LabelFieldIndex;
                ObjectListField labelField      = Control.AllFields[labelFieldIndex];

                writer.EnterFormat(Style);
                for (int i = 0; i < pageSize; i++)
                {
                    ObjectListItem item = items[pageStart + i];
                    if (itemRequiresHyperlink)
                    {
                        RenderPostBackEvent(writer,
                                            requiresSecondScreen ?
                                            String.Format(CultureInfo.InvariantCulture, _showMoreFormatAnchor, item.Index) :
                                            item.Index.ToString(CultureInfo.InvariantCulture),
                                            GetDefaultLabel(GoLabel),
                                            false,
                                            item[labelFieldIndex],
                                            true,
                                            WmlPostFieldType.Raw);
                    }
                    else
                    {
                        writer.RenderText(item[labelFieldIndex], true);
                    }
                }
                writer.ExitFormat(Style);
            }

            writer.ExitLayout(Style);
        }
        public override void Render(WmlMobileTextWriter writer)
        {
            ArrayList          arr;
            DateTime           tempDate;
            DateTimeFormatInfo currentDateTimeInfo        = DateTimeFormatInfo.CurrentInfo;
            String             abbreviatedMonthDayPattern = AbbreviateMonthPattern(currentDateTimeInfo.MonthDayPattern);

            _threadCalendar = currentDateTimeInfo.Calendar;

            // RendersWmlSelectsAsMenuCards is true means the list control will be
            // rendered as select/option tags, where the break tag before
            // them will become an extra line which doesn't like good.
            bool addBreakBeforeListControl = Device.RendersWmlSelectsAsMenuCards;

            writer.EnterStyle(Style);

            Debug.Assert(NotSecondaryUI == NotSecondaryUIInit);
            switch (SecondaryUIMode)
            {
            case FirstPrompt:
                String promptText = Control.CalendarEntryText;
                if (promptText == String.Empty)
                {
                    promptText = SR.GetString(SR.CalendarAdapterFirstPrompt);
                }

                // Link to input option selection screen
                RenderPostBackEvent(writer,
                                    OptionPrompt.ToString(),
                                    GetDefaultLabel(GoLabel),
                                    true,
                                    promptText,
                                    true);
                break;

            // Render the first secondary page that provides differnt
            // options to select a date.
            case OptionPrompt:
                writer.RenderText(SR.GetString(SR.CalendarAdapterOptionPrompt),
                                  !addBreakBeforeListControl);

                arr = new ArrayList();

                // Option to select the default date
                arr.Add(Control.VisibleDate.ToString(
                            currentDateTimeInfo.ShortDatePattern));

                // Option to another page that can enter a date by typing
                arr.Add(SR.GetString(SR.CalendarAdapterOptionType));

                // Options to a set of pages for selecting a date, a week
                // or a month by picking month/year, week and day
                // accordingly.  Available options are determined by
                // SelectionMode.
                arr.Add(SR.GetString(SR.CalendarAdapterOptionChooseDate));

                if (Control.SelectionMode == CalendarSelectionMode.DayWeek ||
                    Control.SelectionMode == CalendarSelectionMode.DayWeekMonth)
                {
                    arr.Add(SR.GetString(SR.CalendarAdapterOptionChooseWeek));

                    if (Control.SelectionMode == CalendarSelectionMode.DayWeekMonth)
                    {
                        arr.Add(SR.GetString(SR.CalendarAdapterOptionChooseMonth));
                    }
                }
                DataBindAndRender(writer, _optionList, arr);
                break;

            // Render a title and textbox to capture a date entered by user
            case TypeDate:
                if (_textBoxErrorMessage != null)
                {
                    writer.RenderText(_textBoxErrorMessage, true);
                }

                if (_selectList.Visible)
                {
                    writer.RenderText(SR.GetString(SR.CalendarAdapterOptionEra), true);
                    _selectList.RenderControl(writer);
                }

                String numericDateFormat = GetNumericDateFormat();

                writer.RenderText(SR.GetString(SR.CalendarAdapterOptionType) + ":", true);
                writer.RenderText("(");
                writer.RenderText(numericDateFormat.ToUpper());
                writer.RenderText(")");

                if (!_selectList.Visible)
                {
                    writer.RenderText(GetEra(Control.VisibleDate));
                }
                writer.RenderText(String.Empty, true);

                _textBox.Numeric   = true;
                _textBox.Size      = numericDateFormat.Length;
                _textBox.MaxLength = numericDateFormat.Length;
                _textBox.Text      = Control.VisibleDate.ToString(numericDateFormat);
                _textBox.Visible   = true;
                _textBox.RenderControl(writer);

                String okLabel = GetDefaultLabel(OKLabel);

                // accept softkey for sending the textbox value back to the server
                RenderPostBackEvent(writer,
                                    TypeDateDone.ToString(),
                                    okLabel,
                                    true,
                                    okLabel,
                                    true,
                                    WmlPostFieldType.Raw);
                break;

            // Render a paged list for choosing a month
            case ChooseMonth:
            {
                String displayText = String.Format("{0}:", SR.GetString(SR.CalendarAdapterOptionChooseMonth));
                writer.RenderText(displayText, !addBreakBeforeListControl);

                tempDate = Control.VisibleDate;

                String abbreviatedYearMonthPattern = AbbreviateMonthPattern(currentDateTimeInfo.YearMonthPattern);

                // This is to be consistent with ASP.NET Calendar control
                // on handling YearMonthPattern:
                // Some cultures have a comma in their YearMonthPattern,
                // which does not look right in a calendar.  Here we
                // strip the comma off.
                int indexComma = abbreviatedYearMonthPattern.IndexOf(',');
                if (indexComma >= 0)
                {
                    abbreviatedYearMonthPattern =
                        abbreviatedYearMonthPattern.Remove(indexComma, 1);
                }

                arr = new ArrayList();
                for (int i = 0; i < _monthsToDisplay; i++)
                {
                    arr.Add(tempDate.ToString(abbreviatedYearMonthPattern));
                    tempDate = _threadCalendar.AddMonths(tempDate, 1);
                }
                arr.Add(GetDefaultLabel(NextLabel));
                arr.Add(GetDefaultLabel(PreviousLabel));
                DataBindAndRender(writer, _monthList, arr);
                break;
            }

            // Based on the month selected in case ChooseMonth above, render a list of
            // availabe weeks of the month.
            case ChooseWeek:
            {
                String monthFormat = (GetNumericDateFormat()[0] == 'y') ? "yyyy/M" : "M/yyyy";
                String displayText = String.Format("{0} ({1}):",
                                                   SR.GetString(SR.CalendarAdapterOptionChooseWeek),
                                                   Control.VisibleDate.ToString(monthFormat));
                writer.RenderText(displayText, !addBreakBeforeListControl);

                // List weeks of days of the selected month.  May include
                // days from the previous and the next month to fill out
                // all six week choices.  This is consistent with the
                // ASP.NET Calendar control.

                // Note that the event handling code of this list control
                // should be implemented according to the index content
                // generated here.

                tempDate = FirstCalendarDay(Control.VisibleDate);

                arr = new ArrayList();
                String weekDisplay;
                for (int i = 0; i < 6; i++)
                {
                    weekDisplay  = tempDate.ToString(abbreviatedMonthDayPattern);
                    weekDisplay += DaySeparator;
                    tempDate     = _threadCalendar.AddDays(tempDate, 6);
                    weekDisplay += tempDate.ToString(abbreviatedMonthDayPattern);
                    arr.Add(weekDisplay);
                    tempDate = _threadCalendar.AddDays(tempDate, 1);
                }
                DataBindAndRender(writer, _weekList, arr);
                break;
            }

            // Based on the month and week selected in case ChooseMonth and ChooseWeek above,
            // render a list of the dates in the week.
            case ChooseDay:
            {
                String displayText = String.Format("{0}:", SR.GetString(SR.CalendarAdapterOptionChooseDate));
                writer.RenderText(displayText, !addBreakBeforeListControl);

                tempDate = Control.VisibleDate;

                arr = new ArrayList();
                String        date;
                String        dayName;
                StringBuilder dayDisplay   = new StringBuilder();
                bool          dayNameFirst = (GetNumericDateFormat()[0] != 'y');

                for (int i = 0; i < 7; i++)
                {
                    date = tempDate.ToString(abbreviatedMonthDayPattern);

                    if (Control.ShowDayHeader)
                    {
                        // Use the short format for displaying day name
                        dayName           = GetAbbreviatedDayName(tempDate);
                        dayDisplay.Length = 0;

                        if (dayNameFirst)
                        {
                            dayDisplay.Append(dayName);
                            dayDisplay.Append(Space);
                            dayDisplay.Append(date);
                        }
                        else
                        {
                            dayDisplay.Append(date);
                            dayDisplay.Append(Space);
                            dayDisplay.Append(dayName);
                        }
                        arr.Add(dayDisplay.ToString());
                    }
                    else
                    {
                        arr.Add(date);
                    }
                    tempDate = _threadCalendar.AddDays(tempDate, 1);
                }
                DataBindAndRender(writer, _dayList, arr);
                break;
            }

            default:
                Debug.Assert(false, "Unexpected Secondary UI Mode");
                break;
            }
            writer.ExitStyle(Style);
        }
 // Methods
 public virtual void Render(WmlMobileTextWriter writer)
 {
 }