/// <summary>
        /// 优化GeneralValidateConfig存储结构
        /// </summary>
        /// <param name="config"></param>
        internal static void OptimizeStrcture(GeneralValidateConfig config)
        {
            AllSubModuleDic = new Dictionary<Guid, GeneralValidateSubModule>();
            FileSubModuleDic = new Dictionary<string, Guid>();
            SubModelActionDic = new Dictionary<Guid, int>();

            foreach (KeyValuePair<Guid, GeneralValidateApplication> application in config.Applications)
            {
                foreach (KeyValuePair<Guid, GeneralValidateModule> module in application.Value.Modules)
                {
                    foreach (KeyValuePair<Guid, GeneralValidateSubModule> subModule in module.Value.SubModules)
                    {
                        AllSubModuleDic.Add(subModule.Key, subModule.Value);
                        foreach (KeyValuePair<string, string> kvp in subModule.Value.Pages)
                        {
                            if (FileSubModuleDic.ContainsKey(kvp.Value) == false)
                            {
                                FileSubModuleDic.Add(kvp.Value, subModule.Key);
                            }
                        }

                        int allActionValues = 0;
                        foreach (KeyValuePair<string, GeneralValidateOperation> kvp in subModule.Value.Operations)
                        {
                            allActionValues += kvp.Value.OperationValue;
                        }
                        SubModelActionDic.Add(subModule.Key, allActionValues);
                    }
                }
            }
        }
        /// <summary>
        /// 获取config节点,创建配置信息实体
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="configContext"></param>
        /// <param name="section"></param>
        /// <returns></returns>
        public object Create(object parent, object configContext, XmlNode section)
        {
            GeneralValidateConfig config = new GeneralValidateConfig();

            foreach (XmlNode applicationNode in section.ChildNodes)
            {
                GeneralValidateApplication application = new GeneralValidateApplication();
                application.Name = applicationNode.Attributes["name"].Value;
                application.Guid = new Guid(applicationNode.Attributes["guid"].Value);

                foreach (XmlNode moduleNode in applicationNode.ChildNodes)
                {
                    GeneralValidateModule module = new GeneralValidateModule();
                    module.Name = moduleNode.Attributes["name"].Value;
                    module.Guid = new Guid(moduleNode.Attributes["guid"].Value);

                    foreach (XmlNode subModuleNode in moduleNode.ChildNodes)
                    {
                        GeneralValidateSubModule subModule = new GeneralValidateSubModule();
                        subModule.Name = subModuleNode.Attributes["name"].Value;
                        subModule.Guid = new Guid(subModuleNode.Attributes["guid"].Value);

                        XmlNodeList pageNodeList = subModuleNode.SelectNodes("pages/page");
                        foreach (XmlNode pageNode in pageNodeList)
                        {
                            subModule.Pages.Add(pageNode.Attributes["name"].Value, pageNode.Attributes["file"].Value.ToLower());
                        }

                        XmlNodeList actionNodeList = subModuleNode.SelectNodes("actions/action");
                        foreach (XmlNode actionNode in actionNodeList)
                        {
                            int actionValue = 0;
                            bool isOkValue = int.TryParse(actionNode.Attributes["value"].Value, out actionValue);
                            if (isOkValue == true)
                            {
                                string actionName = actionNode.Attributes["name"].Value;
                                string actionText = actionName;
                                XmlAttribute actionTextAttribute = actionNode.Attributes["text"];
                                if (actionTextAttribute != null)
                                {
                                    actionText = actionTextAttribute.Value;
                                }

                                GeneralValidateOperation action = new GeneralValidateOperation(actionName, actionText, actionValue);
                                subModule.Operations.Add(actionName, action);
                            }
                        }

                        module.SubModules.Add(subModule.Guid, subModule);
                    }

                    application.Modules.Add(module.Guid, module);
                }

                config.Applications.Add(application.Guid, application);
            }

            GeneralValidateConfig.OptimizeStrcture(config);

            return config;
        }