コード例 #1
0
 /// <summary>
 /// The main 1.
 /// </summary>
 /// <param name="path">
 /// The path.
 /// </param>
 public static void Main1(string path)
 {
     try
     {
         ReflectionOnlyLoadTest rolt = new ReflectionOnlyLoadTest(path);
         rolt.Run();
     }
     catch (Exception e)
     {
         Console.WriteLine("Exception: {0}!!!", e.Message);
     }
 }
コード例 #2
0
        ///// <summary>
        ///// The load assembly in app domain.
        ///// </summary>
        ///// <param name="assemblyPath">
        ///// The assembly path.
        ///// </param>
        //private static void LoadAssemblyInAppDomain(string assemblyPath)
        //{
        //    var DefaultProxy = new Proxy(assemblyPath, "Domain1");

        //    List<MethodInfo> methodInfoList = DefaultProxy.GetMethodInfoFromAssembly();
        //}


        ///// <summary>
        ///// The load byte assembly.
        ///// </summary>
        ///// <param name="path">
        ///// The path.
        ///// </param>
        //private static void LoadByteAssembly(string path)
        //{
        //    for (int i = 0; i < 1000; i++)
        //    {
        //        byte[] readAllBytes = File.ReadAllBytes(path);

        //        var assembly = Assembly.Load(readAllBytes);
        //        readAllBytes = null;

        //        var methodInfos =
        //            assembly.GetTypes()
        //                    .SelectMany(t => t.GetMethods())
        //                    .Where(
        //                        m =>
        //                        m.GetCustomAttributes(typeof (TestScriptInformation), false).Length > 0 ||
        //                        m.GetCustomAttributes(typeof (TestSuideGuids), false).Length > 0)
        //                    .ToList();

        //        Console.WriteLine(i);
        //    }
        //}

        /// <summary>
        /// The get reflection only.
        /// </summary>
        /// <param name="AssemblyPath">
        /// The assembly path.
        /// </param>
        private static void GetReflectionOnly(string AssemblyPath)
        {
            Assembly.ReflectionOnlyLoad(AssemblyPath);

            ReflectionOnlyLoadTest.Main1(AssemblyPath);
        }