示例#1
0
        private static AssemblyModel GetAssembly(string filePath, bool parseNamespace = true)
        {
            var assembly = docParser.Parse(filePath, parseNamespace);

            assembly.FileName = filePath;
            return(assembly);
        }
        private static AssemblyModel GetAssembly(string filePath)
        {
            var assembly = docParser.Parse(filePath);

            assembly.FileName = filePath;
            return(assembly);
        }
示例#3
0
        private Assembly GetNamespace(string file, bool bParseNamespace = true)
        {
            var parser   = new DocParser();
            var assembly = parser.Parse(file, bParseNamespace);

            assembly.FileName = file;
            return(assembly);
        }
示例#4
0
文件: Startup.cs 项目: ntotten/netdoc
        public static async Task<string> ParseProjects(Configuration config)
        {
            var docParser = new DocParser();
            await docParser.Parse(config);

            var settings = new JsonSerializerSettings();
            settings.ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver();
            string json = JsonConvert.SerializeObject(docParser.Data, Formatting.Indented, settings);
            return json;
        }
        public void Upload()
        {
            if (Request.Form.Files.Count <= 0)
            {
                return;
            }
            var file      = Request.Form.Files[0];
            var fullPath  = _fileService.SaveFile(file);
            var p         = new DocParser();
            var viewModel = p.Parse(fullPath);

            viewModel = _menuService.UpdateMenu(viewModel);
        }
示例#6
0
        public async Task ParseTestProjectRuns()
        {
            var namespacesBegins = new string[]
            {
                            "TestProject"
            }.AsEnumerable();

            var path = @"..\..\..\TestProject\TestProject.csproj";
            var baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            var projFile = Path.Combine(baseDir, path);
            var docParser = new DocParser();
            await docParser.Parse(projFile, namespacesBegins);
            Assert.IsNotNull(docParser.Data);
            Assert.IsTrue(docParser.Data.Namespaces.Count() > 0);
        }
示例#7
0
        public async Task ParseTestProjectRuns()
        {
            var namespacesBegins = new string[]
            {
                "TestProject"
            }.AsEnumerable();

            var path      = @"..\..\..\TestProject\TestProject.csproj";
            var baseDir   = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            var projFile  = Path.Combine(baseDir, path);
            var docParser = new DocParser();
            await docParser.Parse(projFile, namespacesBegins);

            Assert.IsNotNull(docParser.Data);
            Assert.IsTrue(docParser.Data.Namespaces.Count() > 0);
        }