summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-04-06 06:58:25 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2017-04-06 06:58:25 (GMT)
commit60bcc0e67ceda984216aabf051bcab9119dd334e (patch)
treeeb140d6d5452a5aa6911a7f4659199f909a44de7
parentbb185bd7545f26dff8a53d799c779f8c4524c602 (diff)
parent2b763c44fdfa89b8f8f28f3d5e37682d6ead0430 (diff)
downloadxamarin-forms-60bcc0e67ceda984216aabf051bcab9119dd334e.zip
xamarin-forms-60bcc0e67ceda984216aabf051bcab9119dd334e.tar.gz
xamarin-forms-60bcc0e67ceda984216aabf051bcab9119dd334e.tar.bz2
Merge "Register assemblies recursively" into tizen
-rw-r--r--Xamarin.Forms.Platform.Tizen/Forms.cs19
-rw-r--r--Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs24
2 files changed, 22 insertions, 21 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Forms.cs b/Xamarin.Forms.Platform.Tizen/Forms.cs
index 177b8c5..7657118 100644
--- a/Xamarin.Forms.Platform.Tizen/Forms.cs
+++ b/Xamarin.Forms.Platform.Tizen/Forms.cs
@@ -159,23 +159,8 @@ namespace Xamarin.Forms.Platform.Tizen
// In .NETCore, AppDomain feature is not supported.
// The list of assemblies returned by AppDomain.GetAssemblies() method should be registered manually.
// The assembly of the executing application and referenced assemblies of it are added into the list here.
- Assembly asm = application.GetType().GetTypeInfo().Assembly;
- TizenPlatformServices.AppDomain.CurrentDomain.RegisterAssembly(asm);
- foreach (var refName in asm.GetReferencedAssemblies())
- {
- if (!refName.Name.StartsWith("System.") && !refName.Name.StartsWith("Microsoft."))
- {
- try
- {
- Assembly refAsm = Assembly.Load(refName);
- TizenPlatformServices.AppDomain.CurrentDomain.RegisterAssembly(refAsm);
- }
- catch
- {
- Log.Warn("Reference Assembly can not be loaded. {0}", refName.FullName);
- }
- }
- }
+ // TODO: AppDomain is comming back in NETStandard2.0. This logic should be changed at that time.
+ TizenPlatformServices.AppDomain.CurrentDomain.RegisterAssemblyRecursively(application.GetType().GetTypeInfo().Assembly);
Device.PlatformServices = new TizenPlatformServices(); ;
if (Device.info != null)
diff --git a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
index a34c2fa..7b07a31 100644
--- a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
+++ b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs
@@ -183,14 +183,30 @@ namespace Xamarin.Forms.Platform.Tizen
_assemblies = new List<Assembly>();
// Add this renderer assembly to the list
- RegisterAssembly(GetType().GetTypeInfo().Assembly);
+ _assemblies.Add(GetType().GetTypeInfo().Assembly);
}
- internal void RegisterAssembly(Assembly asm)
+ internal void RegisterAssemblyRecursively(Assembly asm)
{
- if (!_assemblies.Contains(asm))
+ if (_assemblies.Contains(asm))
+ return;
+
+ _assemblies.Add(asm);
+
+ foreach (var refName in asm.GetReferencedAssemblies())
{
- _assemblies.Add(asm);
+ if (!refName.Name.StartsWith("System.") && !refName.Name.StartsWith("Microsoft.") && !refName.Name.StartsWith("mscorlib"))
+ {
+ try
+ {
+ Assembly refAsm = Assembly.Load(refName);
+ RegisterAssemblyRecursively(refAsm);
+ }
+ catch
+ {
+ Log.Warn("Reference Assembly can not be loaded. {0}", refName.FullName);
+ }
+ }
}
}