コード例 #1
0
ファイル: AssemblyListTests.cs プロジェクト: stantoxt/nunitv2
        public void CanAddAssemblies()
        {
            assemblies.Add(path1);
            assemblies.Add(path2);

            Assert.AreEqual(2, assemblies.Count);
            Assert.AreEqual(path1, assemblies[0]);
            Assert.AreEqual(path2, assemblies[1]);
        }
コード例 #2
0
ファイル: assemblymanager.cs プロジェクト: zjp1907/pythonnet
        /// <summary>
        /// Initialization performed on startup of the Python runtime. Here we
        /// scan all of the currently loaded assemblies to determine exported
        /// names, and register to be notified of new assembly loads.
        /// </summary>
        internal static void Initialize()
        {
            namespaces = new ConcurrentDictionary <string, ConcurrentDictionary <Assembly, string> >();
            probed     = new Dictionary <string, int>(32);
            //generics = new Dictionary<string, Dictionary<string, string>>();
            assemblies = new AssemblyList(16);
            pypath     = new List <string>(16);

            AppDomain domain = AppDomain.CurrentDomain;

            lhandler             = new AssemblyLoadEventHandler(AssemblyLoadHandler);
            domain.AssemblyLoad += lhandler;

            rhandler = new ResolveEventHandler(ResolveHandler);
            domain.AssemblyResolve += rhandler;

            Assembly[] items = domain.GetAssemblies();
            foreach (Assembly a in items)
            {
                try
                {
                    ScanAssembly(a);
                    assemblies.Add(a);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Error scanning assembly {0}. {1}", a, ex);
                }
            }
        }
コード例 #3
0
ファイル: PluginManager.cs プロジェクト: CHiiLD/net-toolkit
 public PluginManager(String path, SearchType type)
     : this(type)
 {
     foreach (FileInfo fi in new DirectoryInfo(path).GetFiles("*.dll"))
     {
         AssemblyList.Add(Assembly.LoadFrom(fi.FullName));
     }
 }
コード例 #4
0
ファイル: ReferenceSolver.cs プロジェクト: qnnnnez/DotHook
 public void ScanAssembly(AssemblyDefinition assembly)
 {
     AssemblyList.Add(assembly);
     foreach (var module in assembly.Modules)
     {
         ScanModule(module);
     }
 }
コード例 #5
0
        //Builds the Assembly, Part and Sheetmetal part objects using recursion
        public void TraverseAssembly(AssemblyDocument currentAsmDocument, int parentID)
        {
            int currentID = GetAssemblyID();

            //to stop instantiating a new instance of Assembly with a null AssemblyDocument - should never happen anyway
            if (currentAsmDocument == null)
            {
                return;
            }

            Assembly assembly = NewAssembly(currentAsmDocument, parentID, currentID);

            EventLogger.CreateLogEntry($"Processing assembly document {assembly.AssemblyDocument.DisplayName}");

            AssemblyList.Add(assembly);

            ComponentOccurrences occurrences = currentAsmDocument.ComponentDefinition.Occurrences;

            noOccurrences += occurrences.Count;
            EventLogger.CreateLogEntry($"Current part count {noOccurrences}");

            foreach (ComponentOccurrence occurrence in occurrences)
            {
                //the UI layer is listening for this Event to increment the progress bar
                IncrementProgressBar();

                if (DocumentInfo.IsPartDocument(occurrence.DefinitionDocumentType))
                {
                    PartDocument partDocument = (PartDocument)occurrence.Definition.Document;
                    EventLogger.CreateLogEntry($"processing part document {partDocument.DisplayName}");

                    if (DocumentInfo.IsSheetMetalPart(partDocument.SubType))
                    {
                        assembly.SheetmetalPartList.Add(NewSheetMetalPart(partDocument));
                    }

                    else
                    {
                        assembly.PartList.Add(NewPart(partDocument));
                    }
                }

                if (DocumentInfo.IsAssemblyDocument(occurrence.DefinitionDocumentType))
                {
                    AssemblyDocument subAssemblyDocument = (AssemblyDocument)occurrence.Definition.Document;

                    TraverseAssembly(subAssemblyDocument, assembly.ID);
                }
            }
        }
コード例 #6
0
        private static int FFI_AddAssembly(ILuaState lua)
        {
            var      name     = lua.ToString(1);
            Assembly assembly = assembly = Assembly.Load(name);

            if (assembly != null)
            {
                AssemblyList.Add(assembly);
            }
            else
            {
                ULDebug.LogError("assembly not found:" + name);
            }
            return(0);
        }
コード例 #7
0
ファイル: LuaFFILib.cs プロジェクト: heycayc/mlbb
        private static int FFI_AddAssembly(ILuaState lua)
        {
            var name     = lua.ToString(1);
            var assembly = Assembly.Load(name);

            if (assembly != null)
            {
                AssemblyList.Add(assembly);
            }
            else
            {
                ClientLog.Instance.LogError("assembly not found:" + name);
            }
            return(0);
        }
コード例 #8
0
        private static int FFI_AddAssembly(ILuaState lua)
        {
            var name = lua.ToString(1);

#if NETFX_CORE && UNITY_METRO && !UNITY_EDITOR
            var assembly = Assembly.Load(new AssemblyName(name));
#else
            var assembly = Assembly.Load(name);
#endif
            if (assembly != null)
            {
                AssemblyList.Add(assembly);
            }
            else
            {
                ULDebug.LogError("assembly not found:" + name);
            }
            return(0);
        }
コード例 #9
0
        public void CanAddAssemblies()
        {
            assemblies.Add(@"C:\tests\bin\debug\assembly1.dll");
            assemblies.Add(@"C:\tests\bin\debug\assembly2.dll");

            Assert.AreEqual(2, assemblies.Count);
            Assert.AreEqual(@"C:\tests\bin\debug\assembly1.dll", assemblies[0].FullPath);
            Assert.AreEqual(@"C:\tests\bin\debug\assembly2.dll", assemblies[1].FullPath);
        }