コード例 #1
0
        private static void Run(string output, string content, string @namespace)
        {
            var outputName     = Path.GetFileNameWithoutExtension(output);
            var contentProject = File.ReadAllText(content);
            var root           = new ContentDirectory();

            MatchCollection matches = Regex.Matches(contentProject, "#begin (?<path>.+)\\..+\\n");

            foreach (Match match in matches)
            {
                var      fullPath    = match.Groups["path"].Value;
                string[] split       = fullPath.Split("/");
                var      file        = split[^ 1];
コード例 #2
0
        public void Insert(Span <string> path, ContentFile contentFile)
        {
            if (path.Length == 0)
            {
                Files.Add(contentFile);
            }
            else
            {
                var directoryName = path[0];
                if (!Directories.TryGetValue(directoryName, out ContentDirectory directory))
                {
                    Directories.Add(directoryName, directory = new ContentDirectory());
                }

                directory.Insert(path[1..], contentFile);