Revert "[Tizen] Add translatable text in TextLabel, TextField, TextEditor" 11/142011/1
authorJinho, Lee <jeano.lee@samsung.com>
Wed, 2 Aug 2017 07:54:31 +0000 (16:54 +0900)
committerJinho, Lee <jeano.lee@samsung.com>
Wed, 2 Aug 2017 07:54:38 +0000 (16:54 +0900)
This reverts commit 70630d9cbf893a8bb9113574a41e2a67fb83a1c6.

Change-Id: I2f24684f63dfa53aa57c49cbb67deb85750b8f9b

Tizen.NUI/Tizen.NUI.csproj
Tizen.NUI/src/internal/WeakEventHandler.cs [deleted file]
Tizen.NUI/src/public/BaseComponents/TextEditor.cs
Tizen.NUI/src/public/BaseComponents/TextField.cs
Tizen.NUI/src/public/BaseComponents/TextLabel.cs
Tizen.NUI/src/public/NUIApplication.cs
packaging/csapi-nui.spec

index 1ae98bb..4b2d09f 100755 (executable)
   <ItemGroup>\r
     <PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" PrivateAssets="All" />\r
     <PackageReference Include="Tizen.Applications.Common" Version="1.5.8" />\r
-    <PackageReference Include="Tizen.System.SystemSettings" Version="1.0.4" PrivateAssets="All"/>\r
   </ItemGroup>\r
-  <Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">\r
-    <ItemGroup>\r
-      <ReferencePath Condition="'%(FileName)' == 'Tizen.System.SystemSettings'">\r
-        <Aliases>TizenSystemSettings</Aliases>\r
-      </ReferencePath>\r
-    </ItemGroup>\r
-  </Target>\r
+\r
 </Project>\r
 \r
diff --git a/Tizen.NUI/src/internal/WeakEventHandler.cs b/Tizen.NUI/src/internal/WeakEventHandler.cs
deleted file mode 100755 (executable)
index b78ee88..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;\r
-using System.Reflection;\r
-\r
-namespace Tizen.NUI\r
-{\r
-    internal sealed class WeakEventHandler<TEventArgs> where TEventArgs : EventArgs\r
-    {\r
-        private readonly WeakReference _targetReference;\r
-        private readonly MethodInfo _method;\r
-\r
-        public WeakEventHandler(EventHandler<TEventArgs> callback)\r
-        {\r
-            _method = callback.GetMethodInfo();           \r
-            _targetReference = new WeakReference(callback.Target, true);\r
-        }\r
-\r
-        public void Handler(object sender, TEventArgs e)\r
-        {\r
-            var target = _targetReference.Target;\r
-            if (target != null)\r
-            {\r
-                var callback = (Action<object, TEventArgs>)_method.CreateDelegate(typeof(Action<object, TEventArgs>), target);\r
-                if (callback != null)\r
-                {\r
-                    callback(sender, e);\r
-                }\r
-            }\r
-        }\r
-}\r
-\r
-}\r
-\r
index 6d1aea5..dfa79bd 100755 (executable)
 *
 */
 
-extern alias TizenSystemSettings;
-using TizenSystemSettings.Tizen.System;
 namespace Tizen.NUI.BaseComponents
 {
 
     using System;
     using System.Runtime.InteropServices;
-    using System.Globalization;
 
     /// <summary>
     /// A control which provides a multi-line editable text editor.
@@ -29,9 +26,6 @@ namespace Tizen.NUI.BaseComponents
     public class TextEditor : View
     {
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-        private string textEditorTextSid = null;
-        private string textEditorPlaceHolderTextSid = null;
-        private bool systemlangTextFlag = false;
 
         internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
         {
@@ -348,81 +342,6 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// TranslatableText property.<br>
-        /// The text can be set SID value.<br>
-        /// </summary>
-        /// <exception cref='ArgumentNullException'>
-        /// ResourceManager about multilingual is null
-        /// </exception>
-        public string TranslatableText
-        {
-            get
-            {
-                return textEditorTextSid;
-            }
-            set
-            {
-                if (NUIApplication.MultilingualResourceManager == null)
-                {
-                    throw new ArgumentNullException("ResourceManager about multilingual is null");
-                }
-                textEditorTextSid = value;
-                Text = SetTranslatable(textEditorTextSid);
-            }
-        }
-        /// <summary>
-        /// TranslatablePlaceholderText property.<br>
-        /// The text can be set SID value.<br>
-        /// </summary>
-        /// <exception cref='ArgumentNullException'>
-        /// ResourceManager about multilingual is null
-        /// </exception>
-        public string TranslatablePlaceholderText
-        {
-            get
-            {
-                return textEditorPlaceHolderTextSid;
-            }
-            set
-            {
-                if (NUIApplication.MultilingualResourceManager == null)
-                {
-                    throw new ArgumentNullException("ResourceManager about multilingual is null");
-                }
-                textEditorPlaceHolderTextSid = value;
-                PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid);
-            }
-        }
-        private string SetTranslatable(string textEditorSid)
-        {
-            string translatableText = null;
-            translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
-            if (translatableText != null)
-            {
-                if (systemlangTextFlag == false)
-                {
-                    SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
-                    systemlangTextFlag = true;
-                }
-                return translatableText;
-            }
-            else
-            {
-                translatableText = "";
-                return translatableText;
-            }
-        }
-        private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
-        {
-            if (textEditorTextSid != null)
-            {
-                Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-")));
-            }
-            if (textEditorPlaceHolderTextSid != null)
-            {
-                PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
-            }
-        }
         /// Text property.
         /// </summary>
         public string Text
index 21fabfe..bcf1a09 100755 (executable)
 * limitations under the License.
 *
 */
-extern alias TizenSystemSettings;
-using TizenSystemSettings.Tizen.System;
+
 namespace Tizen.NUI.BaseComponents
 {
 
     using System;
     using System.Runtime.InteropServices;
-    using System.Globalization;
+
     /// <summary>
     /// A control which provides a single-line editable text field.
     /// </summary>
     public class TextField : View
     {
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-        private string textFieldTextSid = null;
-        private string textFieldPlaceHolderTextSid = null;
-        private bool systemlangTextFlag = false;
 
         internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextField_SWIGUpcast(cPtr), cMemoryOwn)
         {
@@ -333,81 +329,6 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// TranslatableText property.<br>
-        /// The text can be set SID value.<br>
-        /// </summary>
-        /// <exception cref='ArgumentNullException'>
-        /// ResourceManager about multilingual is null
-        /// </exception>
-        public string TranslatableText
-        {
-            get
-            {
-                return textFieldTextSid;
-            }
-            set
-            {
-                if (NUIApplication.MultilingualResourceManager == null)
-                {
-                    throw new ArgumentNullException("ResourceManager about multilingual is null");
-                }
-                textFieldTextSid = value;
-                Text = SetTranslatable(textFieldTextSid);
-            }
-        }
-        /// <summary>
-        /// TranslatablePlaceholderText property.<br>
-        /// The text can be set SID value.<br>
-        /// </summary>
-        /// <exception cref='ArgumentNullException'>
-        /// ResourceManager about multilingual is null
-        /// </exception>
-        public string TranslatablePlaceholderText
-        {
-            get
-            {
-                return textFieldPlaceHolderTextSid;
-            }
-            set
-            {
-                if (NUIApplication.MultilingualResourceManager == null)
-                {
-                    throw new ArgumentNullException("ResourceManager about multilingual is null");
-                }
-                textFieldPlaceHolderTextSid = value;
-                PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid);
-            }
-        }
-        private string SetTranslatable(string textFieldSid)
-        {
-            string translatableText = null;
-            translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
-            if (translatableText != null)
-            {
-                if (systemlangTextFlag == false)
-                {
-                    SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
-                    systemlangTextFlag = true;
-                }
-                return translatableText;
-            }
-            else
-            {
-                translatableText = "";
-                return translatableText;
-            }
-        }
-        private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
-        {
-            if (textFieldTextSid != null)
-            {
-                Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-")));
-            }
-            if (textFieldPlaceHolderTextSid != null)
-            {
-                PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-")));
-            }
-        }
         /// Text property.
         /// </summary>
         public string Text
index f10a7e6..7390f4f 100755 (executable)
 *
 */
 
-extern alias TizenSystemSettings;
-using TizenSystemSettings.Tizen.System;
 using System;
-using System.Globalization;
+
 namespace Tizen.NUI.BaseComponents
 {
 
@@ -28,8 +26,7 @@ namespace Tizen.NUI.BaseComponents
     public class TextLabel : View
     {
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-        private string textLabelSid = null;
-        private bool systemlangTextFlag = false;
+
         internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
         {
             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
@@ -142,47 +139,6 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
-        /// <summary>
-        /// TranslatableText property.<br>
-        /// The text can be set SID value.<br>
-        /// </summary>
-        /// <exception cref='ArgumentNullException'>
-        /// ResourceManager about multilingual is null
-        /// </exception>
-        public string TranslatableText
-        {
-            get
-            {
-                return textLabelSid;
-            }
-            set
-            {
-                if (NUIApplication.MultilingualResourceManager == null)
-                {
-                    throw new ArgumentNullException("ResourceManager about multilingual is null");
-                }
-                string translatableText = null;
-                textLabelSid = value;
-                translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-")));
-                if (translatableText != null)
-                {
-                    Text = translatableText;
-                    if (systemlangTextFlag == false)
-                    {
-                        SystemSettings.LocaleLanguageChanged += new WeakEventHandler<LocaleLanguageChangedEventArgs>(SystemSettings_LocaleLanguageChanged).Handler;
-                        systemlangTextFlag = true;
-                    }
-                }
-                else
-                {
-                    Text = "";
-                }      
-            }
-        }
-        private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e)
-        {
-            Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-")));
-        }
 
         /// <summary>
         /// Text property.<br>
index 1caf135..b5bdacb 100755 (executable)
@@ -27,11 +27,7 @@ namespace Tizen.NUI
     /// Represents an application that have UI screen. The NUIApplication class has a default stage.
     /// </summary>
     public class NUIApplication : CoreApplication
-    {\r
-        /// <summary>
-        /// The instance of ResourceManager.
-        /// </summary>
-        private static System.Resources.ResourceManager resourceManager = null;
+    {
         /// <summary>
         /// The default constructor.
         /// </summary>
@@ -179,7 +175,6 @@ namespace Tizen.NUI
             Opaque = 0,
             Transparent = 1
         }
-<<<<<<< HEAD
 
 
         internal Application ApplicationHandle
@@ -190,21 +185,5 @@ namespace Tizen.NUI
             }
         }
 
-=======
-        /// <summary>
-        /// ResourceManager to handle multilingual
-        /// </summary>
-        public static System.Resources.ResourceManager MultilingualResourceManager
-        {
-            get
-            {
-                return resourceManager;
-            }
-            set
-            {
-                resourceManager = value;
-            }
-        }
->>>>>>> 23f9e83... Add translatable text in TextLabel, TextField, TextEditor
     }
 }
index ebde663..3f444eb 100755 (executable)
@@ -18,7 +18,6 @@ BuildRequires: dotnet-build-tools
 BuildRequires: csapi-tizen-nuget
 BuildRequires: csapi-application-common-nuget
 BuildRequires: csapi-application-ui-nuget
-BuildRequires: csapi-system-settings-nuget
 
 %define Assemblies Tizen.NUI