示例#1
0
 /// <summary> reduce a SelectMultiData to a vector of integers (index mode) or strings (value mode)</summary>
 /// <param name="data">
 /// </param>
 /// <returns>
 /// </returns>
 private System.Collections.ArrayList compactSelectMulti(SelectMultiData data)
 {
     System.Collections.ArrayList val     = (System.Collections.ArrayList)data.Value;
     System.Collections.ArrayList choices = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
     for (int i = 0; i < val.Count; i++)
     {
         choices.Add(extractSelection((Selection)val[i]));
     }
     return(choices);
 }
示例#2
0
        /// <param name="data">The AnswerDataObject to be serialized
        /// </param>
        /// <returns> A string containing the xforms compliant format
        /// for a <select> tag, a string containing a list of answers
        /// separated by space characters.
        /// </returns>
        public virtual System.Object serializeAnswerData(SelectMultiData data)
        {
            System.Collections.ArrayList   selections = (System.Collections.ArrayList)data.Value;
            System.Collections.IEnumerator en         = selections.GetEnumerator();
            StringBuilder selectString = new StringBuilder();

            //UPGRADE_TODO: Method 'java.util.Enumeration.hasMoreElements' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationhasMoreElements'"
            while (en.MoveNext())
            {
                //UPGRADE_TODO: Method 'java.util.Enumeration.nextElement' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationnextElement'"
                Selection selection = (Selection)en.Current;
                if (selectString.length() > 0)
                {
                    selectString.append(DELIMITER);
                }
                selectString.append(selection.Value);
            }
            //As Crazy, and stupid, as it sounds, this is the XForms specification
            //for storing multiple selections.
            return(selectString.toString());
        }