예제 #1
0
        ///############################################################
        /// <summary>
        /// Retrieves the requested Internationalization picklist using the referenced language code.
        /// </summary>
        /// <param name="ePicklist">Enumeration representing the required Internationalization picklist.</param>
        /// <param name="sLanguageCode">String representing the ISO639 2-letter language code to use when collecting the value.</param>
        /// <returns>MultiArray containing all the entries for the passed <paramref>ePicklist</paramref> defined within this instance, or null if it was not defined.</returns>
        ///############################################################
        /// <LastUpdated>May 29, 2007</LastUpdated>
        public MultiArray Values(enumInternationalizationPicklists ePicklist, string sLanguageCode)
        {
            MultiArray oReturn;
            string     sPicklistName;

            //#### Determine the value of the passed ePicklist, setting our return value accordingly
            switch (ePicklist)
            {
            //#### Cn internationalization picklists: non-sLanguageCode prefixed PicklistNames
            case enumInternationalizationPicklists.cnLanguageCodes: {
                oReturn = g_oPicklists.Picklist("LanguageCodes");
                break;
            }

            //#### Cn internationalization picklists: sLanguageCode prefixed PicklistNames
            default: {
                //#### Determine the .ToString-ified version of the passed ePicklist
                sPicklistName = ePicklist.ToString();

                //#### If the sPicklistName value is longer then 2 characters, peal off the leading "cn"
                //####     NOTE: This should always be the case, but we check just in case
                if (sPicklistName.Length > 2)
                {
                    sPicklistName = sPicklistName.Substring(2);
                }

                //#### Toss the sPicklistName into .Picklist (prefixed with the passed sLanguageCode), resetting the oReturn value accordingly
                oReturn = g_oPicklists.Picklist(sLanguageCode + sPicklistName);
                break;
            }
            }

            //#### Return the above determined oReturn value to the caller
            return(oReturn);
        }