public static void Init() { var path = GetDLLPath(); if (path == null) { throw new Exception("EZTransXP를 찾을 수 없습니다"); } EZTransXPHandle = LoadLibrary(Path.Combine(path, "J2KEngine.dll")); if (EZTransXPHandle == IntPtr.Zero) { throw new Exception("J2KEngine.dll 을 로드할 수 없습니다. 경로가 잘못되었거나 EZTransXP가 잘못되었습니다."); } J2K_InitializeEx = Marshal.GetDelegateForFunctionPointer <InitializeEx>(GetProcAddressWithCheck(EZTransXPHandle, "J2K_InitializeEx")); J2K_Terminate = Marshal.GetDelegateForFunctionPointer <Terminate>(GetProcAddressWithCheck(EZTransXPHandle, "J2K_Terminate")); J2K_FreeMem = Marshal.GetDelegateForFunctionPointer <FreeMem>(GetProcAddressWithCheck(EZTransXPHandle, "J2K_FreeMem")); J2K_TranslateMMNT = Marshal.GetDelegateForFunctionPointer <TranslateMMNT>(GetProcAddressWithCheck(EZTransXPHandle, "J2K_TranslateMMNT")); try { J2K_TranslateMMNTW = Marshal.GetDelegateForFunctionPointer <TranslateMMNTW>(GetProcAddressWithCheck(EZTransXPHandle, "J2K_TranslateMMNTW")); }catch (Exception e) { } //From Anemo J2K_InitializeEx("CSUSER123455", Path.Combine(path, "Dat")); IsInited = true; }
public async Task <ActionResult <WorkerHoliday> > PostWorkerHoliday(WorkerHoliday workerHoliday) { IsPossibleAddNewHoliday isPossibleAdd = new IsPossibleAddNewHoliday(); if (isPossibleAdd.HolidayCalc(workerHoliday) == false) { return(BadRequest()); } isPossibleAdd = null; // обрываем все ссылки на объект, на который ссылался dateRecycle FreeMem.CollectMethod(); _context.WorkerHolidays.Add(workerHoliday); await _context.SaveChangesAsync(); return(CreatedAtAction("GetWorkerHoliday", new { id = workerHoliday.PMId }, workerHoliday)); }
public async Task <ActionResult <IEnumerable <WorkerHoliday> > > GetWorkerHolidays() { FreeMem.CollectMethod(); return(await _context.WorkerHolidays.ToListAsync()); }