Example #1
0
        ///############################################################
        /// <summary>
        /// Retrieves the requested Internationalization value using the referenced language code.
        /// </summary>
        /// <param name="eValue">Enumeration representing the required Internationalization value.</param>
        /// <param name="sLanguageCode">String representing the ISO639 2-letter language code to use when collecting the value.</param>
        /// <returns>String representing the requested Internationalization value.</returns>
        ///############################################################
        /// <LastUpdated>May 15, 2007</LastUpdated>
        public string Value(enumInternationalizationValues eValue, string sLanguageCode)
        {
            string[] a_sPicklistInfo;
            string   sReturn;

            //#### Borrow the use of the sReturn value to determine the .ToString-ified version of the passed eValue
            sReturn = eValue.ToString();

            //#### If the borrowed sReturn value is longer then 2 characters, peal off the leading "cn"
            if (sReturn.Length > 2)
            {
                sReturn = sReturn.Substring(2);
            }

            //#### Determine the PicklistName and DecodeValue from the borrowed sReturn value
            a_sPicklistInfo = sReturn.Split("_".ToCharArray(), 2);

            //#### Determine the value of the passed eValue, setting our return value accordingly
            switch (eValue)
            {
            //#### Cn internationalization values: constants
            case enumInternationalizationValues.cnDeveloperMessages_General_MissingDefaultData: {
                sReturn = g_cMissingDefaultData;
                break;
            }

            //#### Cn internationalization values: non-sLanguageCode prefixed PicklistNames
            case enumInternationalizationValues.cnGeneralSettings_DefaultLanguageCode: {
                //#### Toss the PicklistName and DecodeValue into the .Decoder, resetting the sReturn value accordingly
                sReturn = g_oPicklists.Decoder(a_sPicklistInfo[0], a_sPicklistInfo[1]);
                break;
            }

            //#### Cn internationalization values: sLanguageCode prefixed PicklistNames
            default: {
                //#### Toss the PicklistName (prefixed with the sLanguageCode) and DecodeValue into the .Decoder, resetting the sReturn value accordingly
                sReturn = g_oPicklists.Decoder(sLanguageCode + a_sPicklistInfo[0], a_sPicklistInfo[1]);
                break;
            }
            }

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