Exemplo n.º 1
0
        /// <summary>
        /// 获取功能
        /// </summary>
        /// <param name="functionKey"></param>
        /// <returns></returns>
        public FunctionComponent GetFunction(string functionKey)
        {
            FunctionComponent function;

            if (FunctionDict.TryGetValue(functionKey, out function))
            {
                return(function);
            }

            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 从权限键中获取对应的功能列表
        /// </summary>
        /// <param name="permissionKeys"></param>
        /// <returns></returns>
        public Dictionary <string, FunctionComponent> MapFunction(HashSet <string> permissionKeys)
        {
            var functions = new Dictionary <string, FunctionComponent>();

            foreach (string permissionKey in permissionKeys)
            {
                FunctionComponent function;
                if (FunctionDict.TryGetValue(permissionKey, out function))
                {
                    functions.Add(permissionKey, function);
                }
            }
            return(functions);
        }