コード例 #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;
     }
 }
コード例 #2
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;
     }
 }
コード例 #3
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);
        }
コード例 #4
0
 public void Reload(ResourceHandle handle, IEvent evt)
 {
     try
     {
         Reload(handle);
         evt.Finish();
     }
     catch (Exception)
     {
         evt.Abort();
     }
 }