internal static void AssemblyLoad(object sender, AssemblyLoadEventArgs args)
        {
            if (!AssemblySatelliteResolver.log.get_IsErrorEnabled())
            {
                return;
            }
            try
            {
                Assembly      loadedAssembly = args.LoadedAssembly;
                AssemblyName  name           = loadedAssembly.GetName();
                StringBuilder stringBuilder1 = new StringBuilder();
                int           num            = 1;
                bool          flag1          = name.Name.EndsWith(".resources", StringComparison.OrdinalIgnoreCase);
                bool          flag2          = name.Name.IndexOf("Auditing", StringComparison.OrdinalIgnoreCase) > -1;
                bool          flag3          = name.Name.IndexOf(".Strings", StringComparison.OrdinalIgnoreCase) > -1;
                if (flag1)
                {
                    AssemblySatelliteResolver.IntRef intRef;
                    if (!AssemblySatelliteResolver.EntryCount.TryGetValue(name.FullName, out intRef) && !AssemblySatelliteResolver.ResolveCnt.TryGetValue(name.FullName, out intRef))
                    {
                        num = 2;
                    }
                    string[] strArray   = name.Name.Split('.');
                    string   sourceName = string.Join(".", ((IEnumerable <string>)strArray).Take <string>(strArray.Length - 1));
                    Assembly assembly1  = ((IEnumerable <Assembly>)AppDomain.CurrentDomain.GetAssemblies()).FirstOrDefault <Assembly>((Func <Assembly, bool>)(a => a.GetName().Name.Equals(sourceName, StringComparison.OrdinalIgnoreCase)));
                    if (assembly1 != (Assembly)null)
                    {
                        Assembly assembly2 = (Assembly)null;
                        try
                        {
                            assembly2 = assembly1.GetSatelliteAssembly(name.CultureInfo);
                        }
                        catch (FileNotFoundException ex)
                        {
                        }
                        catch (FileLoadException ex)
                        {
                        }
                        if (assembly2 == (Assembly)null || assembly2 != loadedAssembly)
                        {
                            stringBuilder1.AppendLine().AppendFormat("Unexpected satellite for \"{0}\" : \"{1}\"", (object)loadedAssembly, (object)name.CultureInfo.Name);
                            num = 3;
                        }
                    }
                }
                if (!(flag1 | flag2 | flag3))
                {
                    return;
                }
                StringBuilder stringBuilder2 = new StringBuilder().AppendFormat("Loaded \"{0}\" at \"{1}\".{2}", (object)name, (object)AssemblySatelliteResolver.GetSymbolicLocation(loadedAssembly), AssemblySatelliteResolver.GetDebugStackTrace()).Append((object)stringBuilder1);
                switch (num)
                {
                case 1:
                    AssemblySatelliteResolver.log.Info((object)stringBuilder2);
                    break;

                case 2:
                    AssemblySatelliteResolver.log.Warn((object)stringBuilder2);
                    break;

                case 3:
                    AssemblySatelliteResolver.log.Error((object)stringBuilder2);
                    break;
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError("AssemblyLoad failed. {0}", (object)ex);
                AssemblySatelliteResolver.log.FatalFormat("AssemblyLoad failed. {0}", (object)ex);
                GC.KeepAlive((object)ex);
            }
        }
        // Token: 0x06000031 RID: 49 RVA: 0x00003208 File Offset: 0x00001408
        internal static void AssemblyLoad(object sender, AssemblyLoadEventArgs args)
        {
            if (!AssemblySatelliteResolver.log.IsErrorEnabled)
            {
                return;
            }
            try
            {
                Assembly      loadedAssembly = args.LoadedAssembly;
                AssemblyName  name           = loadedAssembly.GetName();
                StringBuilder stringBuilder  = new StringBuilder();
                int           num            = 1;
                bool          flag           = name.Name.EndsWith(".resources", StringComparison.OrdinalIgnoreCase);
                bool          flag2          = name.Name.IndexOf("Auditing", StringComparison.OrdinalIgnoreCase) > -1;
                bool          flag3          = name.Name.IndexOf(".Strings", StringComparison.OrdinalIgnoreCase) > -1;
                if (flag)
                {
                    AssemblySatelliteResolver.IntRef intRef;
                    if (!AssemblySatelliteResolver.EntryCount.TryGetValue(name.FullName, out intRef) && !AssemblySatelliteResolver.ResolveCnt.TryGetValue(name.FullName, out intRef))
                    {
                        num = 2;
                    }
                    string[] array = name.Name.Split(new char[]
                    {
                        '.'
                    });
                    string   sourceName = string.Join(".", array.Take(array.Length - 1));
                    Assembly assembly   = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name.Equals(sourceName, StringComparison.OrdinalIgnoreCase));
                    if (assembly != null)
                    {
                        Assembly left = null;
                        try
                        {
                            left = assembly.GetSatelliteAssembly(name.CultureInfo);
                        }
                        catch (FileNotFoundException)
                        {
                        }
                        catch (FileLoadException)
                        {
                        }
                        if (left == null || left != loadedAssembly)
                        {
                            stringBuilder.AppendLine().AppendFormat("Unexpected satellite for \"{0}\" : \"{1}\"", loadedAssembly, name.CultureInfo.Name);
                            num = 3;
                        }
                    }
                }
                if (flag || flag2 || flag3)
                {
                    StringBuilder stringBuilder2 = new StringBuilder().AppendFormat("Loaded \"{0}\" at \"{1}\".{2}", name, AssemblySatelliteResolver.GetSymbolicLocation(loadedAssembly), AssemblySatelliteResolver.GetDebugStackTrace()).Append(stringBuilder);
                    switch (num)
                    {
                    case 1:
                        AssemblySatelliteResolver.log.Info(stringBuilder2);
                        break;

                    case 2:
                        AssemblySatelliteResolver.log.Warn(stringBuilder2);
                        break;

                    case 3:
                        AssemblySatelliteResolver.log.Error(stringBuilder2);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError("AssemblyLoad failed. {0}", new object[]
                {
                    ex
                });
                AssemblySatelliteResolver.log.FatalFormat("AssemblyLoad failed. {0}", ex);
                GC.KeepAlive(ex);
            }
        }
 internal static Assembly AssemblyResolve(object sender, ResolveEventArgs args)
 {
     try
     {
         AssemblyName assemblyName = new AssemblyName(args.Name);
         if (!assemblyName.Name.EndsWith(".resources", StringComparison.OrdinalIgnoreCase))
         {
             return((Assembly)null);
         }
         bool isLog = AssemblySatelliteResolver.EntryCount.GetOrAdd(assemblyName.FullName, (Func <string, AssemblySatelliteResolver.IntRef>)(_ => new AssemblySatelliteResolver.IntRef(0))).Increment() > 2 && !AssemblySatelliteResolver.ResolveCnt.TryGetValue(assemblyName.FullName, out AssemblySatelliteResolver.IntRef _);
         if (isLog)
         {
             AssemblySatelliteResolver.log.DebugFormat("Resolving satellite assembly \"{0}\"", (object)assemblyName);
         }
         string[]        strArray           = assemblyName.Name.Split('.');
         string          sourceName         = string.Join(".", ((IEnumerable <string>)strArray).Take <string>(strArray.Length - 1));
         string          resolveFileName    = assemblyName.Name + ".dll";
         List <Assembly> assemblyList       = new List <Assembly>((IEnumerable <Assembly>)AppDomain.CurrentDomain.GetAssemblies());
         Assembly        requestingAssembly = args.RequestingAssembly;
         if (requestingAssembly != (Assembly)null)
         {
             assemblyList.Remove(requestingAssembly);
             assemblyList.Insert(0, requestingAssembly);
         }
         foreach (Assembly assembly in assemblyList)
         {
             AssemblyName name = assembly.GetName();
             if (AssemblySatelliteResolver.SatelliteMatchesDefinition(assemblyName, name))
             {
                 bool flag = AssemblySatelliteResolver.ResolveCnt.GetOrAdd(assembly.FullName, (Func <string, AssemblySatelliteResolver.IntRef>)(_ => new AssemblySatelliteResolver.IntRef(0))).Increment() == 1;
                 if (isLog | flag)
                 {
                     AssemblySatelliteResolver.log.InfoFormat("Resolved \"{0}\" as \"{1}\" at \"{2}\"", (object)assemblyName, (object)name, (object)AssemblySatelliteResolver.GetSymbolicLocation(assembly));
                 }
                 return(assembly);
             }
         }
         Assembly resolvedAssembly;
         if (AssemblySatelliteResolver.ProbeViaLoadedAssemblies((ICollection <Assembly>)assemblyList, assemblyName, resolveFileName, requestingAssembly, sourceName, isLog, out resolvedAssembly))
         {
             return(resolvedAssembly);
         }
     }
     catch (Exception ex)
     {
         Trace.TraceError("AssemblyResove failed. {0}", (object)ex);
         AssemblySatelliteResolver.log.FatalFormat("AssemblyResove failed. {0}", (object)ex);
         GC.KeepAlive((object)ex);
     }
     return((Assembly)null);
 }
 // Token: 0x06000030 RID: 48 RVA: 0x00002FD4 File Offset: 0x000011D4
 internal static Assembly AssemblyResolve(object sender, ResolveEventArgs args)
 {
     try
     {
         AssemblyName assemblyName = new AssemblyName(args.Name);
         if (!assemblyName.Name.EndsWith(".resources", StringComparison.OrdinalIgnoreCase))
         {
             return(null);
         }
         AssemblySatelliteResolver.IntRef intRef;
         bool flag = AssemblySatelliteResolver.EntryCount.GetOrAdd(assemblyName.FullName, (string _) => new AssemblySatelliteResolver.IntRef(0)).Increment() > 2 && !AssemblySatelliteResolver.ResolveCnt.TryGetValue(assemblyName.FullName, out intRef);
         if (flag)
         {
             AssemblySatelliteResolver.log.DebugFormat("Resolving satellite assembly \"{0}\"", assemblyName);
         }
         string[] array = assemblyName.Name.Split(new char[]
         {
             '.'
         });
         string          sourceName         = string.Join(".", array.Take(array.Length - 1));
         string          resolveFileName    = assemblyName.Name + ".dll";
         List <Assembly> list               = new List <Assembly>(AppDomain.CurrentDomain.GetAssemblies());
         Assembly        requestingAssembly = args.RequestingAssembly;
         if (requestingAssembly != null)
         {
             list.Remove(requestingAssembly);
             list.Insert(0, requestingAssembly);
         }
         foreach (Assembly assembly in list)
         {
             AssemblyName name = assembly.GetName();
             if (AssemblySatelliteResolver.SatelliteMatchesDefinition(assemblyName, name))
             {
                 bool flag2 = AssemblySatelliteResolver.ResolveCnt.GetOrAdd(assembly.FullName, (string _) => new AssemblySatelliteResolver.IntRef(0)).Increment() == 1;
                 if (flag || flag2)
                 {
                     AssemblySatelliteResolver.log.InfoFormat("Resolved \"{0}\" as \"{1}\" at \"{2}\"", assemblyName, name, AssemblySatelliteResolver.GetSymbolicLocation(assembly));
                 }
                 return(assembly);
             }
         }
         Assembly result;
         if (AssemblySatelliteResolver.ProbeViaLoadedAssemblies(list, assemblyName, resolveFileName, requestingAssembly, sourceName, flag, out result))
         {
             return(result);
         }
     }
     catch (Exception ex)
     {
         Trace.TraceError("AssemblyResove failed. {0}", new object[]
         {
             ex
         });
         AssemblySatelliteResolver.log.FatalFormat("AssemblyResove failed. {0}", ex);
         GC.KeepAlive(ex);
     }
     return(null);
 }