Esempio n. 1
0
        public void Parse(ICLIFlags toolFlags)
        {
            var toolInfo = new ToolInfo();

            toolInfo.AddAssemblyVersion(typeof(UtilToolInfo).Assembly);     // datatool
            toolInfo.AddAssemblyVersion(typeof(teResourceGUID).Assembly);   // tanklib
            toolInfo.AddAssemblyVersion(typeof(ContainerHandler).Assembly); // tactlib

            toolInfo.ToolFlags = new FlagGroup(typeof(ToolFlags));

            var tools = Program.GetTools();

            foreach (Type toolType in tools)
            {
                var attribute = toolType.GetCustomAttribute <ToolAttribute>();
                if (attribute == null)
                {
                    continue;
                }
                if (attribute.IsSensitive || attribute.CustomFlags == null)
                {
                    continue;
                }

                var toolGroup = toolInfo.GetToolGroup(attribute.CustomFlags);
                toolGroup.AddTool(toolType, attribute);
            }

            OutputJSON(toolInfo, (ListFlags)toolFlags);
        }