Beispiel #1
0
 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;
     }
 }
Beispiel #2
0
 public void Load(ResourceHandle handle)
 {
     try
     {
         Intermediate data;
         ResType      res = ReadResourceWithName(handle.Name, out data);
         queue.Add(() =>
         {
             try
             {
                 ThreadLoad(handle, res, data);
             }
             catch (Exception)
             {
                 throw new NotImplementedException("Exception in commandQueue should be handled.");
             }
             finally
             {
                 handle.Finished();
             }
         });
     }
     catch (Exception e)
     {
         handle.Finished();
         throw e;
     }
 }
Beispiel #3
0
 public void Unload(ResourceHandle handle)
 {
     try
     {
         queue.Add(() =>
         {
             try
             {
                 ThreadUnload(handle);
             }
             catch (Exception)
             {
                 throw new NotImplementedException("Exception in commandQueue should be handled.");
             }
             finally
             {
                 handle.Finished();
             }
         });
     }
     catch (Exception)
     {
         handle.Finished();
         throw;
     }
 }
Beispiel #4
0
 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;
     }
 }
Beispiel #5
0
        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 Unload(ResourceHandle handle)
 {
     try {
         doUnload(handle.inactive.resource);
         handle.inactive.resource = null;
         handle.inactive.state    = ResourceState.Empty;
     }
     finally {
         handle.Finished();
     }
 }
 public void Load(ResourceHandle handle)
 {
     try {
         handle.inactive.resource = doLoad(handle.Name);
         handle.inactive.state    = ResourceState.Ready;
         handle.Swap();
     }
     finally {
         handle.Finished();
     }
 }