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