/// <summary> /// 動態建立 Entity 資料列。 /// </summary> /// <param name="instanceType">動態載入物件的型別描述。</param> /// <returns></returns> public static GEntityRow CreateEntityRow(GInstanceType instanceType) { //取得組件的完整路徑 var assemblyFilePath = FileFunc.PathCombine(FileFunc.GetAssemblyPath(), instanceType.AssemblyFile); //動態載入組件,建立指定類別的物件 var assemblyLoader = new GAssemblyLoader(assemblyFilePath); return (GEntityRow)assemblyLoader.CreateInstance(instanceType.TypeName, new object[] { }); }
/// <summary> /// 動態建立功能層級商業邏輯物件。 /// </summary> /// <param name="assemblyFile">組件檔案名稱。</param> /// <param name="typeName">類別名稱。</param> /// <param name="sessionGuid">連線識別。</param> /// <param name="progID">程式代碼。</param> private static IBusinessLogic CreateBusinessLogic(string assemblyFile, string typeName, Guid sessionGuid, string progID) { //取得組件的完整路徑 var sAssemblyFile = FileFunc.PathCombine(FileFunc.GetAssemblyPath(), assemblyFile); //動態載入組件,建立指定類別的物件 var oAssemblyLoader = new GAssemblyLoader(sAssemblyFile); return (IBusinessLogic)oAssemblyLoader.CreateInstance(typeName, new object[] { sessionGuid, progID }); }