X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Finternal%2FApplication.cs;h=43bb36f42d759512ce997d8dfecccb81cd9e1e57;hb=2e2d0feb1e8896e568230e308fed7fa5e4d1f23d;hp=137824553d1f7e80f07dbae9b27a2f93275fd989;hpb=f71e170340660df96ebee7dc6bed84dd7ad1d040;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git
diff --git a/src/Tizen.NUI/src/internal/Application.cs b/src/Tizen.NUI/src/internal/Application.cs
index 1378245..43bb36f 100755
--- a/src/Tizen.NUI/src/internal/Application.cs
+++ b/src/Tizen.NUI/src/internal/Application.cs
@@ -1,5 +1,5 @@
/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,14 @@ namespace Tizen.NUI
{
using System;
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
+ using System.ComponentModel;
using System.Runtime.InteropServices;
+ using System.Threading;
+ using System.Threading.Tasks;
+ using Tizen.NUI.Binding;
+ using Tizen.NUI.Binding.Internals;
/**
* @brief Event arguments that passed via NUIApplicationInit signal
@@ -302,13 +309,159 @@ namespace Tizen.NUI
}
}
- internal class Application : BaseHandle
+ ///
+ /// A class to get resources in current application.
+ ///
+ public class GetResourcesProvider
{
+ ///
+ /// Get resources in current application.
+ ///
+ static public IResourcesProvider Get()
+ {
+ return Tizen.NUI.Application.Current;
+ }
+ }
+
+ internal class Application : BaseHandle, IResourcesProvider, IElementConfiguration
+ {
+
+ static Application s_current;
+
+ ReadOnlyCollection _logicalChildren;
+
+ static SemaphoreSlim SaveSemaphore = new SemaphoreSlim(1, 1);
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void SetCurrentApplication(Application value) => Current = value;
+
+ public static Application Current
+ {
+ get { return s_current; }
+ set
+ {
+ if (s_current == value)
+ return;
+ if (value == null)
+ s_current = null; //Allow to reset current for unittesting
+ s_current = value;
+ }
+ }
+
+ internal override ReadOnlyCollection LogicalChildrenInternal
+ {
+ get { return _logicalChildren ?? (_logicalChildren = new ReadOnlyCollection(InternalChildren)); }
+ }
+
+ internal IResourceDictionary SystemResources { get; }
+
+ ObservableCollection InternalChildren { get; } = new ObservableCollection();
+
+ ResourceDictionary _resources;
+ public bool IsResourcesCreated => _resources != null;
+
+ public delegate void resChangeCb(object sender, ResourcesChangedEventArgs e);
+
+ static private Dictionary