public void TestTypeLoad1() { TypeResolutionService trs = new TypeResolutionService(Path.GetTempPath()); Type t = trs.GetType("Kzu, Clarius"); Assert.IsNull(t); }
public void TestTypeLoad4() { AddTempFiles(2); using (StreamWriter sw = new StreamWriter((string)CodeFiles[0])) { sw.WriteLine(@" namespace TestLoad1 { public class First { public void Hello() { System.Console.WriteLine(""Hello!""); } } }"); } Compile(0); using (StreamWriter sw = new StreamWriter((string)CodeFiles[1])) { sw.WriteLine(@" namespace TestLoad2 { public class Second : TestLoad1.First { } }"); } Compile(1, (string)AsmFiles[0]); TypeResolutionService trs = new TypeResolutionService(Path.GetTempPath()); Type t = trs.GetType("TestLoad2.Second, " + Path.GetFileNameWithoutExtension((string)AsmFiles[1])); Assert.IsNotNull(t); object second = Activator.CreateInstance(t); second.GetType().InvokeMember("Hello", BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod, null, second, new object[0]); }
public void TestTypeLoad3() { AddTempFiles(1); using (StreamWriter sw = new StreamWriter((string)CodeFiles[0])) { sw.WriteLine(@" namespace TestLoad1 { public class First { } }"); } Compile(0); TypeResolutionService trs = new TypeResolutionService(Path.GetTempPath()); Type t = trs.GetType("TestLoad1.First, " + Path.GetFileNameWithoutExtension((string)AsmFiles[0])); Assert.IsNotNull(t); }
public void TestTypeLoad2() { TypeResolutionService trs = new TypeResolutionService(Path.GetTempPath()); Type t = trs.GetType("Kzu, Clarius", true); }
public void TestTypeLoad() { TypeResolutionService trs = new TypeResolutionService(Path.GetTempPath()); Type t = trs.GetType(null); }
public static Type GetDesignModeType([NotNull] string name, bool throwOnError) { ArgumentUtility.CheckNotNullOrEmpty("name", name); return(TypeResolutionService.GetType(ParseAbbreviatedTypeName(name), throwOnError)); }
public static Type GetType([NotNull] string name) { ArgumentUtility.CheckNotNullOrEmpty("name", name); return(TypeResolutionService.GetType(ParseAbbreviatedTypeName(name), false)); }