Example #1
0
        //变更Tool的Content数据
        public void changeItemContentByType(string type, string content)
        {
            Dictionary <string, ToolModel> tools = (data["tools"] as ArrayList)[0] as Dictionary <string, ToolModel>;

            //获取数据
            ToolModel tool = tools[type] as ToolModel;

            //变更属性
            tool.Content = content;

            //重新写入文件
            DataTool.writeConfigToFile();
        }
Example #2
0
        //变更Tool的Enable数据
        public bool changeItemEnableByType(string type)
        {
            Dictionary <string, ToolModel> tools = (data["tools"] as ArrayList)[0] as Dictionary <string, ToolModel>;

            //获取数据
            ToolModel tool = tools[type] as ToolModel;

            //变更属性
            tool.Enable = !tool.Enable;

            //重新写入文件
            DataTool.writeConfigToFile();

            return(tool.Enable);
        }