コード例 #1
0
ファイル: LavaShortcodeCache.cs プロジェクト: sjison/Rock
        /// <summary>
        /// Returns all Lava shortcodes
        /// </summary>
        /// <param name="includeInactive">if set to <c>true</c> [include inactive].</param>
        /// <returns></returns>
        public static List <LavaShortcodeCache> All(bool includeInactive)
        {
            List <LavaShortcodeCache> shortcodes = new List <LavaShortcodeCache>();
            var shortcodeIds = GetOrAddExisting("Rock:LavaShortcode:All", () => LoadAll());

            if (shortcodeIds != null)
            {
                foreach (int shortcodeId in shortcodeIds)
                {
                    var shortcodeCache = LavaShortcodeCache.Read(shortcodeId);
                    if (shortcodeCache != null)
                    {
                        if (includeInactive || shortcodeCache.IsActive)
                        {
                            shortcodes.Add(shortcodeCache);
                        }
                    }
                }
            }
            return(shortcodes);
        }