コード例 #1
0
 public void RegisterLoaded(ILoadReferenceable reffable)
 {
     if (Prefs.DevMode)
     {
         string text = "[excepted]";
         try
         {
             text = reffable.GetUniqueLoadID();
         }
         catch (Exception)
         {
         }
         string text2 = "[excepted]";
         try
         {
             text2 = reffable.ToString();
         }
         catch (Exception)
         {
         }
         ILoadReferenceable loadReferenceable = default(ILoadReferenceable);
         if (this.allObjectsByLoadID.TryGetValue(text, out loadReferenceable))
         {
             Log.Error("Cannot register " + reffable.GetType() + " " + text2 + ", (id=" + text + " in loaded object directory. Id already used by " + loadReferenceable.GetType() + " " + loadReferenceable.ToString() + ".");
             return;
         }
     }
     try
     {
         this.allObjectsByLoadID.Add(reffable.GetUniqueLoadID(), reffable);
     }
     catch (Exception ex5)
     {
         string text3 = "[excepted]";
         try
         {
             text3 = reffable.GetUniqueLoadID();
         }
         catch (Exception)
         {
         }
         string text4 = "[excepted]";
         try
         {
             text4 = reffable.ToString();
         }
         catch (Exception)
         {
         }
         Log.Error("Exception registering " + reffable.GetType() + " " + text4 + " in loaded object directory with unique load ID " + text3 + ": " + ex5);
     }
 }
コード例 #2
0
 public void RegisterLoaded(ILoadReferenceable reffable)
 {
     if (Prefs.DevMode)
     {
         string text = "[excepted]";
         try
         {
             text = reffable.GetUniqueLoadID();
         }
         catch (Exception)
         {
         }
         string text2 = "[excepted]";
         try
         {
             text2 = reffable.ToString();
         }
         catch (Exception)
         {
         }
         if (allObjectsByLoadID.TryGetValue(text, out var value))
         {
             string text3 = "";
             Log.Error(string.Concat("Cannot register ", reffable.GetType(), " ", text2, ", (id=", text, " in loaded object directory. Id already used by ", value.GetType(), " ", value.ToStringSafe(), ".", text3));
             return;
         }
     }
     try
     {
         allObjectsByLoadID.Add(reffable.GetUniqueLoadID(), reffable);
     }
     catch (Exception ex5)
     {
         string text4 = "[excepted]";
         try
         {
             text4 = reffable.GetUniqueLoadID();
         }
         catch (Exception)
         {
         }
         string text5 = "[excepted]";
         try
         {
             text5 = reffable.ToString();
         }
         catch (Exception)
         {
         }
         Log.Error(string.Concat("Exception registering ", reffable.GetType(), " ", text5, " in loaded object directory with unique load ID ", text4, ": ", ex5));
     }
 }
コード例 #3
0
 public void RegisterLoaded(ILoadReferenceable reffable)
 {
     if (Prefs.DevMode)
     {
         string text = "[excepted]";
         try
         {
             text = reffable.GetUniqueLoadID();
         }
         catch (Exception)
         {
         }
         string text2 = "[excepted]";
         try
         {
             text2 = reffable.ToString();
         }
         catch (Exception)
         {
         }
         ILoadReferenceable loadReferenceable;
         if (this.allObjectsByLoadID.TryGetValue(text, out loadReferenceable))
         {
             Log.Error(string.Concat(new object[]
             {
                 "Cannot register ",
                 reffable.GetType(),
                 " ",
                 text2,
                 ", (id=",
                 text,
                 " in loaded object directory. Id already used by ",
                 loadReferenceable.GetType(),
                 " ",
                 loadReferenceable.ToString(),
                 "."
             }), false);
             return;
         }
     }
     try
     {
         this.allObjectsByLoadID.Add(reffable.GetUniqueLoadID(), reffable);
     }
     catch (Exception ex)
     {
         string text3 = "[excepted]";
         try
         {
             text3 = reffable.GetUniqueLoadID();
         }
         catch (Exception)
         {
         }
         string text4 = "[excepted]";
         try
         {
             text4 = reffable.ToString();
         }
         catch (Exception)
         {
         }
         Log.Error(string.Concat(new object[]
         {
             "Exception registering ",
             reffable.GetType(),
             " ",
             text4,
             " in loaded object directory with unique load ID ",
             text3,
             ": ",
             ex
         }), false);
     }
 }