/// <summary/> public static void WaitForCompleteRender() { Type hwndTargetType = typeof(HwndTarget); TrustedAssembly mcasm = TrustedAssembly.GetAssembly(hwndTargetType); TrustedType mcType = mcasm.GetType("System.Windows.Media.MediaContext"); object mediaContext = mcType.InvokeMember("From", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.InvokeMethod, null, null, new object[] { System.Windows.Threading.Dispatcher.CurrentDispatcher }); mcType.InvokeMember("CompleteRender", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod, null, mediaContext, new object[] { }); }
private ICollection GetUnitTestsFromAssembly(TrustedAssembly testExe) { TrustedType[] testTypes = testExe.GetTypes(); ArrayList tests = new ArrayList(); foreach (TrustedType t in testTypes) { if (t.Namespace != null && t.IsSubclassOf(typeof(CoreGraphicsTest)) && (t.Namespace.Contains("UnitTests") || t.Namespace.Contains("Generated"))) { tests.Add(t.Name); } } return(tests); }
private string[] GetUnitTestsFromLoader() { ArrayList tests = new ArrayList(); //Load unit test list from feature team loader tests.AddRange(GetUnitTestsFromAssembly(TrustedAssembly.GetEntryAssembly())); if (tests.Count != 0) { string[] array = new string[tests.Count]; tests.CopyTo(array); return(array); } return(new string[0]); }
/// <summary/> public override void Init(Variation v) { base.Init(v); v.AssertExistenceOf("ClassName", "Namespace", "CanInherit", "Assembly"); this.className = v["ClassName"]; this.nameSpace = v["Namespace"]; string inherit = v["CanInherit"]; string asm = v["Assembly"]; dotnetPath = v["DotnetPath"]; // We define this for local testing if we don't use avalon.msi if (dotnetPath == null) { try { dotnetPath = EnvironmentWrapper.GetEnvironmentVariable("LAPI"); } catch (System.Security.SecurityException ex) { AddFailure("Could not access the Environment variable: LAPI"); Log("Exception: " + ex); } if (dotnetPath == null) { throw new ApplicationException("LAPI is not defined. I can't find my binaries."); } } Log("DotnetPath = " + dotnetPath); TrustedAssembly assembly = TrustedAssembly.LoadFile(TrustedPath.Combine(dotnetPath, asm)); this.type = assembly.GetType(nameSpace + "." + className); if (type == null) { throw new ApplicationException(nameSpace + "." + className + " was not found in " + asm); } this.classGenerator = new ClassGenerator(type); this.canInherit = StringConverter.ToBool(inherit); }
private Type GetAnimationType(Type baseType) { if (baseType.IsValueType) { if (baseType.Name == "Matrix3D") { // Matrix3DAnimation does not exist in Avalon, so use the one that we created return(typeof(Matrix3DAnimation)); } else { TrustedAssembly presentationCore = TrustedAssembly.GetAssembly(typeof(Animatable)); return(PT.Untrust(presentationCore.GetType("System.Windows.Media.Animation." + baseType.Name + "Animation"))); } } else { // Reference-type animations do not exist in Avalon, so use the one that we created return(typeof(DiscreteAnimation)); } }