diff options
author | Jason Smith <jason.smith@xamarin.com> | 2016-03-22 13:02:25 -0700 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-03-22 16:13:41 -0700 |
commit | 17fdde66d94155fc62a034fa6658995bef6fd6e5 (patch) | |
tree | b5e5073a2a7b15cdbe826faa5c763e270a505729 /Xamarin.Forms.Loader/FormsLoader.cs | |
download | xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.gz xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.bz2 xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.zip |
Initial import
Diffstat (limited to 'Xamarin.Forms.Loader/FormsLoader.cs')
-rw-r--r-- | Xamarin.Forms.Loader/FormsLoader.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Xamarin.Forms.Loader/FormsLoader.cs b/Xamarin.Forms.Loader/FormsLoader.cs new file mode 100644 index 00000000..d6826830 --- /dev/null +++ b/Xamarin.Forms.Loader/FormsLoader.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using System.Linq; +using Xamarin.Forms.Core.UITests; + +namespace Xamarin.Forms.Loader +{ + internal sealed class FormsLoader + { + static IEnumerable<FormsType> formsTypes; + static IEnumerable<TestType> iOSTestTypes; + static IEnumerable<TestType> androidTestTypes; + + public FormsLoader() + { + var formsCoreAssembly = typeof (View).Assembly; + var iOSUITestAssembly = typeof (iOSLoaderIdentifier).Assembly; + var androidUITestAssembly = typeof (AndroidLoaderIdentifier).Assembly; + + // skip interfaces, delegates, classes that inherit from attribute + formsTypes = + from o in formsCoreAssembly.GetTypes() + where o.IsVisible && o.IsClass && !o.IsDelegate() && !o.InheritsFromAttribute() && !o.InheritsFromException() + select new FormsType(this, o); + + iOSTestTypes = + from o in iOSUITestAssembly.GetTypes() + where o.IsTestFixture() && o.HasCategoryAttribute() + select new TestType(this, o); + + androidTestTypes = + from o in androidUITestAssembly.GetTypes() + where o.IsTestFixture() && o.HasCategoryAttribute() + select new TestType(this, o); + } + + public IEnumerable<FormsType> FormsTypes() + { + return formsTypes; + } + + public IEnumerable<TestType> IOSTestTypes() + { + return iOSTestTypes; + } + + public IEnumerable<TestType> AndroidTestTypes() + { + return androidTestTypes; + } + } +}
\ No newline at end of file |