Ejemplo n.º 1
0
        public void Edit(StringBuilder builder, ILoaderParameter parameter, int tab_num, string[] paths)
        {
            string tab = StringBuilderHelper.SetTab(tab_num);

            if (paths[0] != ResourcesLoaderCreateUtility.dummyPath)
            {
                paths = paths
                        .Select(p => p.Substring(p.IndexOf(PathArrayEditor.removeWord) + PathArrayEditor.removeWordLength))
                        .Select(p => p.Remove(p.LastIndexOf(".")))
                        .ToArray();
            }

            builder.AppendLine(string.Format("{0}private static readonly string[] {1} = new string[]",
                                             tab,
                                             ResourcesLoaderCreateUtility.GetPathArrayName(parameter)));

            builder.AppendLine(tab + "{");
            builder.AppendLine(StringBuilderHelper.JoinStrings(paths, tab_num + 1, ",\n", "\"", "\""));
            builder.AppendLine(tab + "};");
        }
Ejemplo n.º 2
0
        public void Edit(StringBuilder builder, ILoaderParameter parameter, int tab_num, string[] paths)
        {
            string tab = StringBuilderHelper.SetTab(tab_num);

            builder.AppendLine(string.Format("{0}public static string {1}({2} {3})",
                                             tab,
                                             ResourcesLoaderCreateUtility.GetPathMethodName(parameter),
                                             ResourcesLoaderCreateUtility.GetEnumName(parameter),
                                             argumentEnumName));

            builder.AppendLine(tab + "{");
            tab_num++;
            tab = StringBuilderHelper.SetTab(tab_num);
            {
                builder.AppendLine(string.Format("{0}return {1}[(int){2}];",
                                                 tab,
                                                 ResourcesLoaderCreateUtility.GetPathArrayName(parameter),
                                                 argumentEnumName));
            }
            tab_num--;
            tab = StringBuilderHelper.SetTab(tab_num);
            builder.AppendLine(tab + "}");
        }