/// <summary> /// Creates a DatafileEditor component, designed for editing DataFiles. /// </summary> /// <param name="dataFile">The dataFile in context.</param> /// <param name="fileManager">FileManager dependency.</param> public DatafileEditor(DataFile dataFile, FileManager fileManager) { _dataFile = dataFile; _fileManager = fileManager; _selectedIndexChange = false; _specialControls = new Hashtable(); InitializeComponent(); }
public DataTable LoadTable(DataFile dataFile, bool doRelations, bool force = false) { DataTable dataTable = null; if (dataFile.IsStringsFile) { dataTable = _LoadStringsTable(); } else if (dataFile.IsExcelFile) { dataTable = _LoadExcelTable(dataFile as ExcelFile, doRelations, force); } return dataTable; }
public static ObjectDelegator GetExcelDelegator(DataFile excelFile, IDictionary<String, ObjectDelegator> objectDelegators) { ObjectDelegator excelDelegator; if (!objectDelegators.TryGetValue(excelFile.StringId, out excelDelegator)) { Type rowType = excelFile.Attributes.RowType; FieldInfo[] fieldInfos = rowType.GetFields(); excelDelegator = new ObjectDelegator(fieldInfos); objectDelegators.Add(excelFile.StringId, excelDelegator); } return excelDelegator; }