private void AddOnEnterForward(XhtmlMobileTextWriter writer)
        {
            if (Control.SelectType == ListSelectType.CheckBox)
            {
                // ASURT 142732
                writer.AddOnEnterForwardSetVar(Control.UniqueID);
                return;
            }
            bool          firstIndex = true;
            StringBuilder builder    = new StringBuilder();

            for (int i = 0; i < Control.Items.Count; i++)
            {
                if (Control.Items[i].Selected)
                {
                    if (!firstIndex)
                    {
                        builder.Append(";");
                    }
                    builder.Append(i.ToString(CultureInfo.InvariantCulture));
                    firstIndex = false;
                }
            }
            writer.AddOnEnterForwardSetVar(Control.UniqueID, builder.ToString());
        }
 private void AddOnEnterForward(XhtmlMobileTextWriter writer) {
     if (Control.SelectType == ListSelectType.CheckBox) {
         // ASURT 142732
         writer.AddOnEnterForwardSetVar(Control.UniqueID);
         return;
     }
     bool firstIndex = true;
     StringBuilder builder = new StringBuilder();
     for (int i = 0; i < Control.Items.Count; i++) {
         if (Control.Items[i].Selected) {
             if (!firstIndex) {
                 builder.Append(";");
             }
             builder.Append(i.ToString(CultureInfo.InvariantCulture));
             firstIndex = false;
         }
     }
     writer.AddOnEnterForwardSetVar(Control.UniqueID, builder.ToString());
 }
Exemplo n.º 3
0
        /// <include file='doc\XhtmlBasicTextBoxAdapter.uex' path='docs/doc[@for="XhtmlTextBoxAdapter.Render"]/*' />
        public override void Render(XhtmlMobileTextWriter writer)
        {
            ConditionalClearPendingBreak(writer);
            ConditionalEnterStyle(writer, Style);
            ConditionalRenderOpeningSpanElement(writer);

            if ((String)Device[XhtmlConstants.RequiresOnEnterForward] == "true")
            {
                writer.AddOnEnterForwardSetVar(Control.UniqueID, Control.Text);
            }

            writer.WriteBeginTag("input");

            writer.WriteAttribute("name", Control.UniqueID);

            ConditionalRenderCustomAttribute(writer, XhtmlConstants.AccessKeyCustomAttribute);
            String controlText = Control.Text;

            if (controlText != null && controlText.Length > 0 && !Control.Password)
            {
                writer.Write(" value=\"");
                writer.WriteEncodedText(controlText);
                writer.Write("\"");
            }

            if (Control.Size > 0)
            {
                writer.WriteAttribute("size", Control.Size.ToString(CultureInfo.InvariantCulture));
            }

            if (Control.MaxLength > 0)
            {
                writer.WriteAttribute("maxlength", Control.MaxLength.ToString(CultureInfo.InvariantCulture));
            }

            String requiresType = Device["requiresInputTypeAttribute"];

            if (Control.Password)
            {
                writer.WriteAttribute("type", "password");
            }
            // InvariantCulture not needed, but included for best practices.
            else if (requiresType != null && String.Equals(requiresType, "true", StringComparison.OrdinalIgnoreCase))
            {
                writer.WriteAttribute("type", "text");
            }


            writer.Write("/>");
            // ConditionalSetPendingBreak should always be called *before* ConditionalExitStyle.
            // ConditionalExitStyle may render a block element and clear the pending break.
            ConditionalSetPendingBreakAfterInline(writer);
            ConditionalRenderClosingSpanElement(writer);
            ConditionalExitStyle(writer, Style);
        }
        /// <include file='doc\XhtmlBasicTextBoxAdapter.uex' path='docs/doc[@for="XhtmlTextBoxAdapter.Render"]/*' />
        public override void Render(XhtmlMobileTextWriter writer) {
            ConditionalClearPendingBreak(writer);
            ConditionalEnterStyle(writer, Style);
            ConditionalRenderOpeningSpanElement(writer);

            if ((String) Device[XhtmlConstants.RequiresOnEnterForward] == "true") {
                writer.AddOnEnterForwardSetVar(Control.UniqueID, Control.Text);
            }
            
            writer.WriteBeginTag("input");

            writer.WriteAttribute("name", Control.UniqueID);

            ConditionalRenderCustomAttribute(writer, XhtmlConstants.AccessKeyCustomAttribute);
            String controlText = Control.Text;
            if (controlText != null && controlText.Length > 0 && !Control.Password) {
                writer.Write(" value=\"");
                writer.WriteEncodedText(controlText);
                writer.Write("\"");
            }

            if (Control.Size > 0) {
                writer.WriteAttribute("size", Control.Size.ToString(CultureInfo.InvariantCulture));
            }

            if (Control.MaxLength > 0) {
                writer.WriteAttribute("maxlength", Control.MaxLength.ToString(CultureInfo.InvariantCulture));
            }

            String requiresType = Device["requiresInputTypeAttribute"];
            if (Control.Password) {
                writer.WriteAttribute("type", "password");
            }
            // InvariantCulture not needed, but included for best practices.
            else if (requiresType != null && String.Equals(requiresType, "true", StringComparison.OrdinalIgnoreCase)) {
                writer.WriteAttribute("type", "text");
            }


            writer.Write("/>");
            // ConditionalSetPendingBreak should always be called *before* ConditionalExitStyle.
            // ConditionalExitStyle may render a block element and clear the pending break.
            ConditionalSetPendingBreakAfterInline(writer);            
            ConditionalRenderClosingSpanElement(writer);
            ConditionalExitStyle(writer, Style);
        }