Cleaned up some unused/commented code

- Small amount of refactoring
- Separated imagesharp extension to ImageSharpExtensions.cs
- Using .join Ienumerable extension instead of string.join in some places
This commit is contained in:
Kwoth
2022-01-04 09:06:42 +01:00
parent 3aa6a54b6e
commit f13d7d2c80
15 changed files with 159 additions and 209 deletions

View File

@@ -96,57 +96,6 @@ public class CmdAttribute : System.Attribute
}
}
// private static void GenerateFileFromModel(in SourceProductionContext ctx, IGrouping<string, DataModel> @group)
// {
// using var sw = new StringWriter();
// using var tw = new IndentedTextWriter(sw);
//
// foreach (var model in group)
// {
// tw.WriteLine($"public partial {model.ReturnType} {model.MethodName}({string.Join(", ", model.Params)});");
// }
//
// GenerateFileFromModel(ctx, sw.ToString(), group.Key, group.AsEnumerable());
//
//
// }
// private static void GenerateFileFromModel(SourceProductionContext ctx, string innerContent, string groupName, IEnumerable<DataModel> modelsEnum)
// {
// using var sw = new StringWriter();
// using var tw = new IndentedTextWriter(sw);
//
// var models = modelsEnum.ToList();
// var referenceModel = models.First();
// tw.WriteLine($"namespace {referenceModel.Namespace};");
//
// foreach (var className in referenceModel.ClassNames.Reverse().ToList())
// {
// tw.WriteLine($"public partial class {className}");
// tw.WriteLine("{");
// tw.WriteLine();
// tw.Indent ++;
// }
//
// foreach (var model in models)
// {
// tw.WriteLine($"public partial {model.ReturnType} {model.MethodName}({string.Join(", ", model.Params)});");
// }
//
// foreach (var _ in referenceModel.ClassNames)
// {
// tw.Indent --;
// tw.WriteLine("}");
// }
//
// // tw.Indent--;
// // tw.WriteLine("}");
// tw.Flush();
//
// ctx.AddSource($"{groupName}.qwertyus.g.cs",
// SourceText.From(sw.ToString(), Encoding.UTF8));
// }
private static string GetSourceText(FileModel model)
{
using var sw = new StringWriter();