예제 #1
0
        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;
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public static void Open()
 {
     instance = CreateInstance <ExcelImporter>();
     instance.Init();
     instance.Show();
 }