예제 #1
0
        /// <summary>
        /// 通过路径获取标签bean
        /// </summary>
        /// <param name="isThis">该路径是否是标签所标注的路径</param>
        public static TagBean GetTagByPath(string path, out bool isThis)
        {
            DirTagBean[] dirTags = InternalStorage.Get(InternalStorage.Domain.tag, "tagSort") as DirTagBean[];
            uint         tagId   = 0;

            isThis = false;
            foreach (DirTagBean dirTag in dirTags)
            {
                if (path.IndexOf(dirTag.Path) != -1)
                {
                    tagId = dirTag.TagId;
                    if (dirTag.Path == path)
                    {
                        isThis = true;
                    }
                    break;
                }
            }
            if (tagId == 0)
            {
                return(null);
            }
            else
            {
                return(TagMapper.GetOneById(tagId));
            }
        }
예제 #2
0
        /// <summary>
        /// 当内存中没有数据时,放入数据
        /// </summary>
        public static void CheckTagSort()
        {
            object obj = InternalStorage.Get(InternalStorage.Domain.tag, "tagSort");

            if (obj == null)
            {
                SetTagSort();
            }
        }