9 changed files with 66 additions and 21 deletions
@ -1,25 +1,34 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace Tools.ExcelResolver.Editor |
||||
{ |
||||
internal class ClassCodeData |
||||
internal class ClassCodeData : IDisposable |
||||
{ |
||||
public TableType tableType; |
||||
public string className; |
||||
public Dictionary<int, FieldData> fields = new(); |
||||
// public FieldData[] fields; |
||||
// public int[] keyIndex; |
||||
public readonly string className; |
||||
public Dictionary<int, FieldData> fields; |
||||
public FieldData[] keyField; |
||||
|
||||
public ClassCodeData(string className) |
||||
{ |
||||
this.className = $"{char.ToUpper(className[0])}{className.Substring(1)}"; |
||||
|
||||
// keyField = new FieldData[keyIndex.Length]; |
||||
// for (int i = 0; i < keyIndex.Length; i++) |
||||
// { |
||||
// keyField[i] = fields.First(f => f.colIndex == keyIndex[i]); |
||||
// } |
||||
} |
||||
|
||||
public void Dispose() |
||||
{ |
||||
foreach (var field in fields.Values) |
||||
{ |
||||
field.Dispose(); |
||||
} |
||||
fields.Clear(); |
||||
fields = null; |
||||
|
||||
foreach (var fieldData in keyField) |
||||
{ |
||||
fieldData?.Dispose(); |
||||
} |
||||
keyField = null; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue