コード例 #1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="ElementCacheKey" /> class.
		/// </summary>
		/// <param name="element">The element.</param>
		public ElementCacheKey(Element element)
			: this(element.Name, element.Category, element.Culture)
		{

		}
コード例 #2
0
        /// <summary>
        /// Maps the specified source.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="key">The key.</param>
        /// <param name="category">The category.</param>
        /// <param name="culture">The culture.</param>
        /// <returns>Mapped Element.</returns>
        public static Element Map(this string source, string key, string category, CultureInfo culture)
        {
            if (string.IsNullOrWhiteSpace(key))
            {
                return Element.Empty;
            }

            var repository = ServiceLocator.Current.GetInstance<IElementRepository>();
            var element = repository.Get(key, category, culture.Name);
            if (element == null)
            {
                element = new Element { Name = key, Category = category, Culture = culture.Name, Value = source };
                repository.Add(element);
            }
            return element;
        }
コード例 #3
0
 public bool Update(Element element)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 public bool Remove(Element element)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
 public bool Add(Element element)
 {
     return true;
 }