Example #1
0
        /// <summary>
        /// Get a list of a translation for a function translation key
        /// </summary>
        /// <param name="functionKey">Function translation key</param>
        /// <returns>List of translation</returns>
        public List <Translation> GetFunctionTranslation(string functionKey)
        {
            FunctionTranslation function = (from s in Current.Functions where s.Key == functionKey select s).FirstOrDefault();

            if (function == null)
            {
                throw new CoreEngineException(typeof(CultureManager).FullName, string.Format(Pulsar.Resources.Exceptions.CultureManager.FunctionNotFind, functionKey));
            }

            return(function.Translations);
        }
Example #2
0
        /// <summary>
        /// Define if a FunctionTranslation object is equals with the current object instance
        /// </summary>
        /// <param name="conf">FunctionTranslation to compare</param>
        /// <returns>True if equals</returns>
        public bool Equals(FunctionTranslation func)
        {
            if (func == null)
            {
                return(false);
            }

            if (this.Key == func.Key && this.Translations.Count == func.Translations.Count)
            {
                for (int i = 0, l = this.Translations.Count; i < l; i++)
                {
                    if (!this.Translations[i].Equals(func.Translations[i]))
                    {
                        return(false);
                    }
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }