partial void LoadDataSetFromExcel(Type objType, RName name, ref bool result) { var imp = new ExcelImporter(); if (false == imp.Init(name.Address)) { result = false; return; } mDataRows = imp.Table2Objects2(objType); result = true; }
public async Task SetObjectToEdit(ResourceEditorContext context) { await EngineNS.Thread.AsyncDummyClass.DummyFunc(); if (context.ResInfo == null) { return; } ResourceInfo = context.ResInfo as ExcelResourceInfo; if (ResourceInfo == null) { return; } //UIPanel.Children.Clear(); var filename = ResourceInfo.AbsInfoFileName.Replace(".rinfo", ""); FileName = filename; if (System.IO.File.Exists(filename)) { ExcelImporter import = new ExcelImporter(); import.Init(filename); var method = import.GetType().GetMethod("Table2Objects"); //var assembly = EngineNS.Rtti.RttiHelper.GetAssemblyFromDllFileName(EngineNS.ECSType.Common, EngineNS.CEngine.Instance.FileManager.Bin + "MacrossScript.dll", "", true); var assembly = EngineNS.CEngine.Instance.MacrossDataManager.MacrossScripAssembly;// Assembly.LoadFile(EngineNS.CEngine.Instance.FileManager.Bin + "MacrossScript.dll"); try { MacrossName = ResourceInfo.MacrossName; var type = EngineNS.Macross.MacrossFactory.Instance.GetMacrossType(MacrossName); ObjectList = method.MakeGenericMethod(type).Invoke(import, null) as IList; RefreshDatas(); } catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } else { //ClassInfo.AddNode(_ClassType.ClassName, _ClassType); } }
public static void Open() { instance = CreateInstance <ExcelImporter>(); instance.Init(); instance.Show(); }