Remove InternalsVissibleTo from Core to XF.Platforms.Tizen
authorKangho Hur <kangho.hur@samsung.com>
Mon, 24 Apr 2017 09:33:06 +0000 (18:33 +0900)
committerKangho Hur <kangho.hur@samsung.com>
Mon, 10 Jul 2017 02:11:23 +0000 (11:11 +0900)
- Please refer to prior patch (#782)

18 files changed:
Xamarin.Forms.Platform.Tizen/Deserializer.cs
Xamarin.Forms.Platform.Tizen/Extensions/KeyboardExtensions.cs
Xamarin.Forms.Platform.Tizen/Extensions/NativeBindingExtensions.cs
Xamarin.Forms.Platform.Tizen/Forms.cs
Xamarin.Forms.Platform.Tizen/FormsApplication.cs
Xamarin.Forms.Platform.Tizen/GestureDetector.cs
Xamarin.Forms.Platform.Tizen/Log/XamarinLogListener.cs
Xamarin.Forms.Platform.Tizen/Native/Image.cs [changed mode: 0755->0644]
Xamarin.Forms.Platform.Tizen/Native/ListView.cs
Xamarin.Forms.Platform.Tizen/NativeBindingService.cs
Xamarin.Forms.Platform.Tizen/NativeValueConverterService.cs
Xamarin.Forms.Platform.Tizen/Platform.cs
Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs [changed mode: 0755->0644]
Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs
Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs [changed mode: 0755->0644]
Xamarin.Forms.Platform.Tizen/Renderers/WebViewRenderer.cs
Xamarin.Forms.Platform.Tizen/ResourcesProvider.cs
Xamarin.Forms.Platform.Tizen/TizenIsolatedStorageFile.cs

index 8335840..3366e06 100644 (file)
@@ -5,6 +5,7 @@ using System.Runtime.Serialization;
 using System.Xml;
 using System.Diagnostics;
 using System.IO;
+using Xamarin.Forms.Internals;
 
 namespace Xamarin.Forms.Platform.Tizen
 {
@@ -37,7 +38,7 @@ namespace Xamarin.Forms.Platform.Tizen
                                catch (Exception e)
                                {
                                        Debug.WriteLine("Could not deserialize properties: " + e.Message);
-                                       Xamarin.Forms.Log.Warning("Xamarin.Forms PropertyStore", $"Exception while reading Application properties: {e}");
+                                       Internals.Log.Warning("Xamarin.Forms PropertyStore", $"Exception while reading Application properties: {e}");
                                }
                                finally
                                {
@@ -76,7 +77,7 @@ namespace Xamarin.Forms.Platform.Tizen
                                catch (Exception e)
                                {
                                        Debug.WriteLine("Could not serialize properties: " + e.Message);
-                                       Xamarin.Forms.Log.Warning("Xamarin.Forms PropertyStore", $"Exception while writing Application properties: {e}");
+                                       Internals.Log.Warning("Xamarin.Forms PropertyStore", $"Exception while writing Application properties: {e}");
                                }
                                finally
                                {
@@ -98,7 +99,7 @@ namespace Xamarin.Forms.Platform.Tizen
                                catch (Exception e)
                                {
                                        Debug.WriteLine("Could not move new serialized property file over old: " + e.Message);
-                                       Xamarin.Forms.Log.Warning("Xamarin.Forms PropertyStore", $"Exception while writing Application properties: {e}");
+                                       Internals.Log.Warning("Xamarin.Forms PropertyStore", $"Exception while writing Application properties: {e}");
                                }
                        });
                }
index 9cc02b2..20017c2 100644 (file)
@@ -1,3 +1,5 @@
+using Xamarin.Forms;
+
 namespace Xamarin.Forms.Platform.Tizen
 {
        public static class KeyboardExtensions
@@ -9,23 +11,23 @@ namespace Xamarin.Forms.Platform.Tizen
                /// <param name="keyboard">The Xamarin.Forms.Keyboard class instance to be converted to ElmSharp.Keyboard.</param>
                public static Native.Keyboard ToNative(this Keyboard keyboard)
                {
-                       if (keyboard is NumericKeyboard)
+                       if (keyboard == Keyboard.Numeric)
                        {
                                return Native.Keyboard.Number;
                        }
-                       else if (keyboard is TelephoneKeyboard)
+                       else if (keyboard == Keyboard.Telephone)
                        {
                                return Native.Keyboard.PhoneNumber;
                        }
-                       else if (keyboard is EmailKeyboard)
+                       else if (keyboard == Keyboard.Email)
                        {
                                return Native.Keyboard.Email;
                        }
-                       else if (keyboard is UrlKeyboard)
+                       else if (keyboard == Keyboard.Url)
                        {
                                return Native.Keyboard.Url;
                        }
-                       else if (keyboard is ChatKeyboard)
+                       else if (keyboard == Keyboard.Chat)
                        {
                                return Native.Keyboard.Emoticon;
                        }
index b04894b..cf80a7f 100644 (file)
@@ -1,6 +1,6 @@
 using System;
 using System.Collections.Generic;
-
+using Xamarin.Forms.Internals;
 using EObject = ElmSharp.EvasObject;
 
 namespace Xamarin.Forms.Platform.Tizen
index 7657118..d9b73bf 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Linq.Expressions;
 using System.Reflection;
+using Xamarin.Forms.Internals;
 using ElmSharp;
 using Tizen.Applications;
 using TSystemInfo = Tizen.System.SystemInfo;
@@ -141,13 +142,13 @@ namespace Xamarin.Forms.Platform.Tizen
 
                static void SetupInit(FormsApplication application)
                {
-                       Color.Accent = GetAccentColor();
+                       Color.SetAccent(GetAccentColor());
 
                        Context = application;
 
                        if (!IsInitialized)
                        {
-                               Xamarin.Forms.Log.Listeners.Add(new XamarinLogListener());
+                               Internals.Log.Listeners.Add(new XamarinLogListener());
                                if (System.Threading.SynchronizationContext.Current == null)
                                {
                                        TizenSynchronizationContext.Initialize();
@@ -186,19 +187,19 @@ namespace Xamarin.Forms.Platform.Tizen
                        string profile = ((TizenDeviceInfo)Device.Info).Profile;
                        if (profile == "mobile")
                        {
-                               Device.Idiom = TargetIdiom.Phone;
+                               Device.SetIdiom(TargetIdiom.Phone);
                        }
                        else if (profile == "tv")
                        {
-                               Device.Idiom = TargetIdiom.TV;
+                               Device.SetIdiom(TargetIdiom.TV);
                        }
                        else if (profile == "desktop")
                        {
-                               Device.Idiom = TargetIdiom.Desktop;
+                               Device.SetIdiom(TargetIdiom.Desktop);
                        }
                        else
                        {
-                               Device.Idiom = TargetIdiom.Unsupported;
+                               Device.SetIdiom(TargetIdiom.Unsupported);
                        }
 
                        ExpressionSearch.Default = new TizenExpressionSearch();
index 83efe7a..e00c390 100644 (file)
@@ -1,6 +1,7 @@
 using System;
 using System.ComponentModel;
 using System.Diagnostics;
+using Xamarin.Forms.Internals;
 using Tizen.Applications;
 using ElmSharp;
 using EButton = ElmSharp.Button;
@@ -306,23 +307,23 @@ namespace Xamarin.Forms.Platform.Tizen
                                switch (_window.CurrentOrientation)
                                {
                                        case Native.DisplayOrientations.None:
-                                               Device.Info.CurrentOrientation = DeviceOrientation.Other;
+                                               Device.Info.CurrentOrientation = Internals.DeviceOrientation.Other;
                                                break;
 
                                        case Native.DisplayOrientations.Portrait:
-                                               Device.Info.CurrentOrientation = DeviceOrientation.PortraitUp;
+                                               Device.Info.CurrentOrientation = Internals.DeviceOrientation.PortraitUp;
                                                break;
 
                                        case Native.DisplayOrientations.Landscape:
-                                               Device.Info.CurrentOrientation = DeviceOrientation.LandscapeLeft;
+                                               Device.Info.CurrentOrientation = Internals.DeviceOrientation.LandscapeLeft;
                                                break;
 
                                        case Native.DisplayOrientations.PortraitFlipped:
-                                               Device.Info.CurrentOrientation = DeviceOrientation.PortraitDown;
+                                               Device.Info.CurrentOrientation = Internals.DeviceOrientation.PortraitDown;
                                                break;
 
                                        case Native.DisplayOrientations.LandscapeFlipped:
-                                               Device.Info.CurrentOrientation = DeviceOrientation.LandscapeRight;
+                                               Device.Info.CurrentOrientation = Internals.DeviceOrientation.LandscapeRight;
                                                break;
                                }
                        };
index 2bbb066..bf33809 100644 (file)
@@ -3,7 +3,7 @@ using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Collections.Specialized;
 using System.Linq;
-using System.Reflection;
+using Xamarin.Forms.Internals;
 using ElmSharp;
 using EColor = ElmSharp.Color;
 using EGestureType = ElmSharp.GestureLayer.GestureType;
index 02bdb0f..ecd373d 100644 (file)
@@ -1,4 +1,4 @@
-using System;
+using Xamarin.Forms.Internals;
 
 namespace Xamarin.Forms.Platform.Tizen
 {
old mode 100755 (executable)
new mode 100644 (file)
index ceae4e5..37602a0
@@ -1,4 +1,5 @@
 using System.Threading.Tasks;
+using Xamarin.Forms.Internals;
 using ElmSharp;
 using EImage = ElmSharp.Image;
 using ESize = ElmSharp.Size;
index 7947c3e..fed9910 100644 (file)
@@ -2,6 +2,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.ComponentModel;
+using Xamarin.Forms.Internals;
 using ElmSharp;
 
 namespace Xamarin.Forms.Platform.Tizen.Native
index 945726e..d5c3f96 100644 (file)
@@ -1,10 +1,11 @@
-using System;
+using Xamarin.Forms.Internals;
+using Xamarin.Forms.Xaml.Internals;
 
 using EObject = ElmSharp.EvasObject;
 
 namespace Xamarin.Forms.Platform.Tizen
 {
-       class NativeBindingService : Xaml.INativeBindingService
+       class NativeBindingService : INativeBindingService
        {
                public bool TrySetBinding(object target, string propertyName, BindingBase binding)
                {
index 956079e..72d124d 100644 (file)
@@ -1,10 +1,12 @@
 using System;
+using Xamarin.Forms.Internals;
+using Xamarin.Forms.Xaml.Internals;
 
 using EObject = ElmSharp.EvasObject;
 
 namespace Xamarin.Forms.Platform.Tizen
 {
-       class NativeValueConverterService : Xaml.INativeValueConverterService
+       class NativeValueConverterService : INativeValueConverterService
        {
                public bool ConvertTo(object value, Type toType, out object nativeValue)
                {
index 4fe56e3..8abea63 100644 (file)
@@ -2,6 +2,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using Xamarin.Forms.Internals;
 using ElmSharp;
 
 namespace Xamarin.Forms.Platform.Tizen
old mode 100755 (executable)
new mode 100644 (file)
index 1fed8a3..d2b325a
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Specialized;
+using Xamarin.Forms.Internals;
 using ElmSharp;
 using EProgressBar = ElmSharp.ProgressBar;
 using ERect = ElmSharp.Rect;
@@ -17,6 +18,9 @@ namespace Xamarin.Forms.Platform.Tizen
        /// </summary>
        public class ListViewRenderer : ViewRenderer<ListView, Native.ListView>, IDisposable
        {
+               IListViewController Controller => Element;
+               ITemplatedItemsView<Cell> TemplatedItemsView => Element;
+
                /// <summary>
                /// Event handler for ScrollToRequested.
                /// </summary>
@@ -184,7 +188,7 @@ namespace Xamarin.Forms.Platform.Tizen
                        int position;
                        var scrollArgs = (ITemplatedItemsListScrollToRequestedEventArgs)e;
 
-                       var templatedItems = Element.TemplatedItems;
+                       var templatedItems = TemplatedItemsView.TemplatedItems;
                        if (Element.IsGroupingEnabled)
                        {
                                var results = templatedItems.GetGroupAndIndexOfItem(scrollArgs.Group, scrollArgs.Item);
@@ -417,7 +421,7 @@ namespace Xamarin.Forms.Platform.Tizen
                        }
                        else
                        {
-                               var templatedItems = Element.TemplatedItems;
+                               var templatedItems = TemplatedItemsView.TemplatedItems;
                                var results = templatedItems.GetGroupAndIndexOfItem(Element.SelectedItem);
                                if (results.Item1 != -1 && results.Item2 != -1)
                                {
index fb17b31..a0cca4e 100644 (file)
@@ -442,20 +442,17 @@ namespace Xamarin.Forms.Platform.Tizen
                        GetNaviItemForPage(nre.Page).Delete();
                }
 
-               async void InsertPageBeforeRequestedHandler(object sender, NavigationRequestedEventArgs nre)
+               void InsertPageBeforeRequestedHandler(object sender, NavigationRequestedEventArgs nre)
                {
-                       TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
-                       if (Element.CurrentNavigationTask != null && !Element.CurrentNavigationTask.IsCompleted)
-                       {
-                               await Element.CurrentNavigationTask;
-                       }
-                       Element.CurrentNavigationTask = tcs.Task;
+                       if (nre.BeforePage == null)
+                               throw new ArgumentNullException("before");
+                       if (nre.Page == null)
+                               throw new ArgumentNullException("page");
 
                        Device.StartTimer(TimeSpan.FromMilliseconds(0), () =>
                        {
                                EvasObject page = Platform.GetOrCreateRenderer(nre.Page).NativeView;
                                _naviFrame.InsertBefore(GetNaviItemForPage(nre.BeforePage), page, SpanTitle(nre.Page.Title));
-                               tcs.SetResult(true);
 
                                UpdateHasNavigationBar(nre.Page);
                                return false;
old mode 100755 (executable)
new mode 100644 (file)
index 8b28869..512e304
@@ -1,7 +1,7 @@
 using System;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.ComponentModel;
+using Xamarin.Forms.Internals;
 using ElmSharp;
 using ESize = ElmSharp.Size;
 using ERect = ElmSharp.Rect;
@@ -718,7 +718,7 @@ namespace Xamarin.Forms.Platform.Tizen
                        Layout layout = Element as Layout;
                        if (layout != null)
                        {
-                               layout.InvalidateMeasureInternal(Internals.InvalidationTrigger.MeasureChanged);
+                               layout.InvalidateMeasureNonVirtual(InvalidationTrigger.MeasureChanged);
                                layout.ForceLayout();
                        }
                }
@@ -742,8 +742,8 @@ namespace Xamarin.Forms.Platform.Tizen
                /// <param name="effect">The effect to register.</param>
                void OnRegisterEffect(PlatformEffect effect)
                {
-                       effect.Container = Element.Parent == null ? null : Platform.GetRenderer(Element.Parent).NativeView;
-                       effect.Control = NativeView;
+                       effect.SetContainer(Element.Parent == null ? null : Platform.GetRenderer(Element.Parent).NativeView);
+                       effect.SetControl(NativeView);
                }
 
                void OnMoved(object sender, EventArgs e)
index 56579fb..cb61aa5 100644 (file)
@@ -12,6 +12,8 @@ namespace Xamarin.Forms.Platform.Tizen
                WebNavigationEvent _eventState;
                TWebView _control = null;
 
+               IWebViewController ElementController => Element;
+
                public void LoadHtml(string html, string baseUrl)
                {
                        _control.LoadHtml(html, baseUrl);
@@ -170,8 +172,8 @@ namespace Xamarin.Forms.Platform.Tizen
 
                void UpdateCanGoBackForward()
                {
-                       Element.CanGoBack = _control.CanGoBack();
-                       Element.CanGoForward = _control.CanGoForward();
+                       ElementController.CanGoBack = _control.CanGoBack();
+                       ElementController.CanGoForward = _control.CanGoForward();
                }
        }
 }
\ No newline at end of file
index 15e7485..e042d08 100644 (file)
@@ -1,3 +1,5 @@
+using Xamarin.Forms.Internals;
+
 namespace Xamarin.Forms.Platform.Tizen
 {
        internal class ResourcesProvider : ISystemResourcesProvider
index 0550d9d..ec50c8a 100644 (file)
@@ -1,6 +1,7 @@
 using System;
 using System.IO;
 using System.Threading.Tasks;
+using Xamarin.Forms.Internals;
 using TApplication = Tizen.Applications.Application;
 
 namespace Xamarin.Forms.Platform.Tizen
@@ -111,12 +112,12 @@ namespace Xamarin.Forms.Platform.Tizen
                        return new FileStream(fullPath, mode, access, share);
                }
 
-               public Task<Stream> OpenFileAsync(string path, FileMode mode, FileAccess access)
+               public Task<Stream> OpenFileAsync(string path, Internals.FileMode mode, Internals.FileAccess access)
                {
                        return Task.FromResult(OpenFile(path, (System.IO.FileMode)mode, (System.IO.FileAccess)access));
                }
 
-               public Task<Stream> OpenFileAsync(string path, FileMode mode, FileAccess access, FileShare share)
+               public Task<Stream> OpenFileAsync(string path, Internals.FileMode mode, Internals.FileAccess access, Internals.FileShare share)
                {
                        return Task.FromResult(OpenFile(path, (System.IO.FileMode)mode, (System.IO.FileAccess)access, (System.IO.FileShare)share));
                }