public void Unload(ResourceHandle handle, IEvent evt) { try { queue.Add(() => { try { ThreadUnload(handle); evt.Finish(); } catch (Exception) { evt.Abort(); } finally { handle.Finished(); } }); } catch (Exception) { handle.Finished(); evt.Abort(); throw; } }
public void Load(ResourceHandle handle, IEvent evt) { try { Intermediate data; ResType res = ReadResourceWithName(handle.Name, out data); queue.Add(() => { try { try { ThreadLoad(handle, res, data); } finally { handle.Finished(); } evt.Finish(); } catch (Exception) { evt.Abort(); } }); } catch (Exception) { handle.Finished(); evt.Abort(); throw; } }
public void Reload(ResourceHandle handle, IEvent evt) { try { queue.Add(() => { try { ThreadUnload(handle); } catch (Exception) { throw new NotImplementedException("Exception in commandQueue should be handled."); } }); } catch (Exception) { handle.Finished(); evt.Abort(); throw; } Load(handle, evt); }
public void Reload(ResourceHandle handle, IEvent evt) { try { Reload(handle); evt.Finish(); } catch (Exception) { evt.Abort(); } }