Ejemplo n.º 1
0
        /// <summary>
        /// <para>Iterator </para>
        /// </summary>
        /// <param name="containerType">
        /// <para>Container type. Recommend using a CacheContainer.</para>
        /// </param>
        /// <param name="keys">
        /// <para>Represents the cache key.</para>
        /// </param>
        public object this[Enum containerType, params string[] keys]
        {
            get
            {
                if (keys == null || keys.Length == 0)
                {
                    return(null);
                }

                ContainerTemplate container = this.GetContainer(containerType);

                if (container == null)
                {
                    return(null);
                }

                container.CheckExpired();

                object ct = container[keys];

                return(ct);
            }
            set
            {
                this.Add(containerType, value, keys);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// <para>Check all items expired and remove from cache. </para>
        /// </summary>
        /// <param name="containerType">
        /// <para>Container type. Recommend using a CacheContainer.</para>
        /// </param>
        public void CheckExpired(Enum containerType)
        {
            ContainerTemplate container = this.GetContainer(containerType);

            if (container != null)
            {
                container.CheckExpired();
            }
        }