Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="label"></param>
        /// <param name="resourceString"></param>
        /// <param name="type"></param>
        public void GetLabel(out string label, string resourceString, Type type, string baseName)
        {
            string temp = null;

            if (LabelCacheKey == "Label")
            {
                object value = GetFromCache("Label");
                if (value == null)
                {
                    value = CultureManager.GetResourceString(resourceString, type, baseName);
                    SetCache(LabelCacheKey, value);
                    temp = (string)value;
                }
            }
            else
            {
                object value = GetFromCache(LabelCacheKey);
                if (value == null)
                {
                    value = CultureManager.GetResourceString(LabelCacheKey, type, CacheManager.BaseName_Custom);
                    SetCache(LabelCacheKey, value);
                    temp = (string)value;
                }
            }
            label = temp;
        }
Beispiel #2
0
        /// <summary>
        /// Gets the text or error message for this item.
        /// </summary>
        /// <param name="resourceString">Base name of the resx file.</param>
        /// <param name="type">Calling type.</param>
        /// <returns></returns>
        public string GetResourceText(string resourceString, Type type)
        {
            string temp  = String.Empty;
            object value = CultureManager.GetResourceString(resourceString, type, "Sasoma.Api.Languages.ErrorMessages");

            if (value != null)
            {
                return(value.ToString());
            }
            return(temp);
        }