コード例 #1
0
        /// <summary>
        /// 解析字典。
        /// </summary>
        /// <param name="dictionaryString">要解析的字典字符串。</param>
        /// <param name="userData">用户自定义数据。</param>
        /// <returns>是否解析字典成功。</returns>
        public bool ParseDictionary(string dictionaryString, object userData)
        {
            if (m_LocalizationHelper == null)
            {
                throw new GameFrameworkException("You must set localization helper first.");
            }

            if (dictionaryString == null)
            {
                throw new GameFrameworkException("Dictionary string is invalid.");
            }

            try
            {
                return(m_LocalizationHelper.ParseDictionary(dictionaryString, userData));
            }
            catch (Exception exception)
            {
                if (exception is GameFrameworkException)
                {
                    throw;
                }

                throw new GameFrameworkException(Utility.Text.Format("Can not parse dictionary string with exception '{0}'.", exception.ToString()), exception);
            }
        }
コード例 #2
0
        /// <summary>
        /// 解析字典。
        /// </summary>
        /// <param name="text">要解析的字典文本。</param>
        /// <param name="userData">用户自定义数据。</param>
        /// <returns>是否解析字典成功。</returns>
        public bool ParseDictionary(string text, object userData)
        {
            if (m_LocalizationHelper == null)
            {
                throw new GameFrameworkException("You must set localization helper first.");
            }

            return(m_LocalizationHelper.ParseDictionary(text, userData));
        }
コード例 #3
0
        /// <summary>
        /// 解析字典。
        /// </summary>
        /// <param name="text">要解析的字典文本。</param>
        /// <param name="userData">用户自定义数据。</param>
        /// <returns>是否解析字典成功。</returns>
        public bool ParseDictionary(string text, object userData)
        {
            if (m_LocalizationHelper == null)
            {
                throw new GXException("You must set localization helper first.");
            }

            try
            {
                return(m_LocalizationHelper.ParseDictionary(text, userData));
            }
            catch (Exception exception)
            {
                if (exception is GXException)
                {
                    throw;
                }

                throw new GXException(Utility.Text.Format("Can not parse dictionary with exception '{0}'.", exception.ToString()), exception);
            }
        }