Beispiel #1
0
        protected virtual string GetMacroName(string typename, AttributeParser att, out string[] args,
                                              out string outputname)
        {
            var(typea0, macroname) = att.GetArgument(0);
            switch (typea0)
            {
            case ArgumentType.Null:
                args      = new[] { att.GetStrippedArgument(0), att.GetStrippedArgument(1), att.GetStrippedArgument(2) };
                macroname = "Any";
                break;

            case ArgumentType.String:
                args = new[] { att.GetStrippedArgument(1), att.GetStrippedArgument(2), att.GetStrippedArgument(3) };
                break;

            default:
                args = new[] { att.GetStrippedArgument(0), att.GetStrippedArgument(1), att.GetStrippedArgument(2) };
                break;
            }

            if (!macroname.EndsWith(".csmacro"))
            {
                macroname = $"{AttributeName}.{macroname}.csmacro";
            }

            if (string.IsNullOrEmpty(args[0]))
            {
                args[0] = att.Name;
            }
            // ReSharper disable once InvokeAsExtensionMethod
            outputname = RegexHelper.NoInvalidChars($"{typename}.{args[0]}.{Prefix}Auto.cs");
            return(macroname);
        }