Exemplo n.º 1
0
        /// <summary>
        /// Get a subsection of the current resource bundle, identified by a string key.
        /// </summary>
        /// <param name="sectionName">String name of the subsection to get</param>
        /// <returns>A new IcuResourceBundle instance representing the subsection. Disposing of it properly is the responsibility of the caller.</returns>
        public IcuResourceBundle GetSubsection(string sectionName)
        {
            if (this.IsNullBundle)
            {
                return(this);
            }
            IntPtr bundlePtr = Icu.GetResourceBundleSubsection(m_bundle, sectionName);

            if (bundlePtr == IntPtr.Zero)
            {
                return(NullResourceBundle());                 // Technically this isn't required, but let's be explicit about what we're returning here.
            }
            return(new IcuResourceBundle(bundlePtr));
        }