Пример #1
0
        public static bool IsLibLoaded(ImportedLibInfo lib)
        {
            for (int i = 0; i < LoadedLibs.Count; i++)
            {
                if (LoadedLibs[i].assembly.FullName == lib.assembly.FullName)
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #2
0
        /// <summary>
        /// Add library to environment and all it's references
        /// </summary>
        /// <param name="i">Library information</param>
        public static void AddLibrary(ImportedLibInfo i, bool addReferenced = true)
        {
            if (IsLibLoaded(i))
            {
                return;
            }

            if (addReferenced)
            {
                foreach (var reference in i.assembly.GetReferencedAssemblies())
                {
                    AddLibrary(new ImportedLibInfo(Assembly.Load(reference)), false);
                    //Debug.Log("ENV", $"[{i.assembly.FullName}] module: {reference.Name}");
                }
            }

            Debug.Log("ENV", " + lib \"" + i.assembly.FullName + "\"");

            LoadedLibs.Add(i);
        }