Ver Fonte

引导key

zouweichen há 5 meses atrás
pai
commit
5f94161271

+ 4 - 1
etoy/Components/CodeGenerater/CSharp/CSharpGuideTargetKeyGenerater.cs

@@ -25,7 +25,7 @@
         private void GenGuideTargetKey(Context context, Table table)
         {
             var filePath = $"{context.Option.ClientCodeOutput}/{KeyName}.cs";
-
+            var hashTable = new List<string>();
             using var writer = new CodeWriter(filePath);
             writer.WriteLine("// Generate By EToy");
             writer.WriteLine("// Don't Edit It!!");
@@ -41,8 +41,11 @@
                         GetKeyProperty(row, out var key, out var summary);
                         if (string.IsNullOrEmpty(key))
                             continue;
+                        if (hashTable.Contains(key))
+                            continue;
                         writer.Summary(summary);
                         writer.WriteLine($"public readonly static string {key} = \"{key}\";");
+                        hashTable.Add(key);
                     }
                     writer.EndBracket();
                 }