Esempio n. 1
0
        /**
         * {@icu} Returns a resource in a given resource that has a given key.
         *
         * @param aKey               a key associated with the wanted resource
         * @return                  a resource bundle object representing the resource
         * @throws MissingResourceException If resource bundle is missing.
         * @stable ICU 3.8
         */
        public virtual UResourceBundle Get(string aKey) // ICU4N TODO: API make into indexer property
        {
            UResourceBundle obj = FindTopLevel(aKey);

            if (obj == null)
            {
                string fullName = ICUResourceBundleReader.GetFullName(GetBaseName(), GetLocaleID());
                throw new MissingManifestResourceException(
                          "Can't find resource for bundle " + fullName + ", key "
                          + aKey + "Type: " + this.GetType().FullName + " Key: " + aKey);
            }
            return(obj);
        }
Esempio n. 2
0
        /// <summary>
        /// <icu/> Returns a resource in a given resource that has a given key.
        /// </summary>
        /// <param name="aKey">A key associated with the wanted resource.</param>
        /// <returns>A resource bundle object representing the resource.</returns>
        /// <exception cref="MissingManifestResourceException">If resource bundle is missing.</exception>
        /// <stable>ICU 3.8</stable>
        public virtual UResourceBundle Get(string aKey) // ICU4N TODO: API make into indexer property
        {
#pragma warning disable 612, 618
            UResourceBundle obj = FindTopLevel(aKey);
#pragma warning restore 612, 618
            if (obj == null)
            {
                string fullName = ICUResourceBundleReader.GetFullName(BaseName, LocaleID);
                throw new MissingManifestResourceException(
                          "Can't find resource for bundle " + fullName + ", key "
                          + aKey + "Type: " + this.GetType().FullName + " Key: " + aKey);
            }
            return(obj);
        }