コード例 #1
0
        public static bool ReLoad()
        {
            bool result;

            try
            {
                Dictionary <string, FusionInfo> tempFusions = new Dictionary <string, FusionInfo>();
                if (FusionMgr.LoadFusion(tempFusions))
                {
                    FusionMgr.m_lock.AcquireWriterLock(-1);
                    try
                    {
                        FusionMgr._fusions = tempFusions;
                        result             = true;
                        return(result);
                    }
                    catch
                    {
                    }
                    finally
                    {
                        FusionMgr.m_lock.ReleaseWriterLock();
                    }
                }
            }
            catch (Exception e)
            {
                //if (FusionMgr.log.IsErrorEnabled)
                {
                    FusionMgr.log.Error("FusionMgr", e);
                }
            }
            result = false;
            return(result);
        }
コード例 #2
0
ファイル: FusionMgr.cs プロジェクト: changthai2540/DDTank-II
 public static bool ReLoad()
 {
     try
     {
         Dictionary <string, FusionInfo> dictionary = new Dictionary <string, FusionInfo>();
         if (FusionMgr.LoadFusion(dictionary))
         {
             FusionMgr.m_lock.AcquireWriterLock(15000);
             try
             {
                 FusionMgr._fusions = dictionary;
                 return(true);
             }
             catch
             {
             }
             finally
             {
                 FusionMgr.m_lock.ReleaseWriterLock();
             }
         }
     }
     catch (Exception exception)
     {
         if (FusionMgr.log.IsErrorEnabled)
         {
             FusionMgr.log.Error("FusionMgr", exception);
         }
     }
     return(false);
 }
コード例 #3
0
        public static bool Init()
        {
            bool result;

            try
            {
                FusionMgr.m_lock   = new ReaderWriterLock();
                FusionMgr._fusions = new Dictionary <string, FusionInfo>();
                result             = FusionMgr.LoadFusion(FusionMgr._fusions);
            }
            catch (Exception e)
            {
                //	if (FusionMgr.log.IsErrorEnabled)
                {
                    FusionMgr.log.Error("FusionMgr", e);
                }
                result = false;
            }
            return(result);
        }