From: Kangho Hur Date: Mon, 24 Apr 2017 09:33:06 +0000 (+0900) Subject: Remove InternalsVissibleTo from Core to XF.Platforms.Tizen X-Git-Tag: accepted/tizen/4.0/unified/20170816.011313~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=977f9f9705404ce7ab77d0c9513939864d140001;p=platform%2Fupstream%2Fxamarin-forms.git Remove InternalsVissibleTo from Core to XF.Platforms.Tizen - Please refer to prior patch (#782) --- diff --git a/Xamarin.Forms.Platform.Tizen/Deserializer.cs b/Xamarin.Forms.Platform.Tizen/Deserializer.cs index 8335840..3366e06 100644 --- a/Xamarin.Forms.Platform.Tizen/Deserializer.cs +++ b/Xamarin.Forms.Platform.Tizen/Deserializer.cs @@ -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}"); } }); } diff --git a/Xamarin.Forms.Platform.Tizen/Extensions/KeyboardExtensions.cs b/Xamarin.Forms.Platform.Tizen/Extensions/KeyboardExtensions.cs index 9cc02b2..20017c2 100644 --- a/Xamarin.Forms.Platform.Tizen/Extensions/KeyboardExtensions.cs +++ b/Xamarin.Forms.Platform.Tizen/Extensions/KeyboardExtensions.cs @@ -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 /// The Xamarin.Forms.Keyboard class instance to be converted to ElmSharp.Keyboard. 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; } diff --git a/Xamarin.Forms.Platform.Tizen/Extensions/NativeBindingExtensions.cs b/Xamarin.Forms.Platform.Tizen/Extensions/NativeBindingExtensions.cs index b04894b..cf80a7f 100644 --- a/Xamarin.Forms.Platform.Tizen/Extensions/NativeBindingExtensions.cs +++ b/Xamarin.Forms.Platform.Tizen/Extensions/NativeBindingExtensions.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; - +using Xamarin.Forms.Internals; using EObject = ElmSharp.EvasObject; namespace Xamarin.Forms.Platform.Tizen diff --git a/Xamarin.Forms.Platform.Tizen/Forms.cs b/Xamarin.Forms.Platform.Tizen/Forms.cs index 7657118..d9b73bf 100644 --- a/Xamarin.Forms.Platform.Tizen/Forms.cs +++ b/Xamarin.Forms.Platform.Tizen/Forms.cs @@ -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(); diff --git a/Xamarin.Forms.Platform.Tizen/FormsApplication.cs b/Xamarin.Forms.Platform.Tizen/FormsApplication.cs index 83efe7a..e00c390 100644 --- a/Xamarin.Forms.Platform.Tizen/FormsApplication.cs +++ b/Xamarin.Forms.Platform.Tizen/FormsApplication.cs @@ -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; } }; diff --git a/Xamarin.Forms.Platform.Tizen/GestureDetector.cs b/Xamarin.Forms.Platform.Tizen/GestureDetector.cs index 2bbb066..bf33809 100644 --- a/Xamarin.Forms.Platform.Tizen/GestureDetector.cs +++ b/Xamarin.Forms.Platform.Tizen/GestureDetector.cs @@ -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; diff --git a/Xamarin.Forms.Platform.Tizen/Log/XamarinLogListener.cs b/Xamarin.Forms.Platform.Tizen/Log/XamarinLogListener.cs index 02bdb0f..ecd373d 100644 --- a/Xamarin.Forms.Platform.Tizen/Log/XamarinLogListener.cs +++ b/Xamarin.Forms.Platform.Tizen/Log/XamarinLogListener.cs @@ -1,4 +1,4 @@ -using System; +using Xamarin.Forms.Internals; namespace Xamarin.Forms.Platform.Tizen { diff --git a/Xamarin.Forms.Platform.Tizen/Native/Image.cs b/Xamarin.Forms.Platform.Tizen/Native/Image.cs old mode 100755 new mode 100644 index ceae4e5..37602a0 --- a/Xamarin.Forms.Platform.Tizen/Native/Image.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/Image.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using Xamarin.Forms.Internals; using ElmSharp; using EImage = ElmSharp.Image; using ESize = ElmSharp.Size; diff --git a/Xamarin.Forms.Platform.Tizen/Native/ListView.cs b/Xamarin.Forms.Platform.Tizen/Native/ListView.cs index 7947c3e..fed9910 100644 --- a/Xamarin.Forms.Platform.Tizen/Native/ListView.cs +++ b/Xamarin.Forms.Platform.Tizen/Native/ListView.cs @@ -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 diff --git a/Xamarin.Forms.Platform.Tizen/NativeBindingService.cs b/Xamarin.Forms.Platform.Tizen/NativeBindingService.cs index 945726e..d5c3f96 100644 --- a/Xamarin.Forms.Platform.Tizen/NativeBindingService.cs +++ b/Xamarin.Forms.Platform.Tizen/NativeBindingService.cs @@ -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) { diff --git a/Xamarin.Forms.Platform.Tizen/NativeValueConverterService.cs b/Xamarin.Forms.Platform.Tizen/NativeValueConverterService.cs index 956079e..72d124d 100644 --- a/Xamarin.Forms.Platform.Tizen/NativeValueConverterService.cs +++ b/Xamarin.Forms.Platform.Tizen/NativeValueConverterService.cs @@ -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) { diff --git a/Xamarin.Forms.Platform.Tizen/Platform.cs b/Xamarin.Forms.Platform.Tizen/Platform.cs index 4fe56e3..8abea63 100644 --- a/Xamarin.Forms.Platform.Tizen/Platform.cs +++ b/Xamarin.Forms.Platform.Tizen/Platform.cs @@ -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 diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs old mode 100755 new mode 100644 index 1fed8a3..d2b325a --- a/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/ListViewRenderer.cs @@ -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 /// public class ListViewRenderer : ViewRenderer, IDisposable { + IListViewController Controller => Element; + ITemplatedItemsView TemplatedItemsView => Element; + /// /// Event handler for ScrollToRequested. /// @@ -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) { diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs index fb17b31..a0cca4e 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/NavigationPageRenderer.cs @@ -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 tcs = new TaskCompletionSource(); - 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; diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs old mode 100755 new mode 100644 index 8b28869..512e304 --- a/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/VisualElementRenderer.cs @@ -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 /// The effect to register. 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) diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/WebViewRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/WebViewRenderer.cs index 56579fb..cb61aa5 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/WebViewRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/WebViewRenderer.cs @@ -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 diff --git a/Xamarin.Forms.Platform.Tizen/ResourcesProvider.cs b/Xamarin.Forms.Platform.Tizen/ResourcesProvider.cs index 15e7485..e042d08 100644 --- a/Xamarin.Forms.Platform.Tizen/ResourcesProvider.cs +++ b/Xamarin.Forms.Platform.Tizen/ResourcesProvider.cs @@ -1,3 +1,5 @@ +using Xamarin.Forms.Internals; + namespace Xamarin.Forms.Platform.Tizen { internal class ResourcesProvider : ISystemResourcesProvider diff --git a/Xamarin.Forms.Platform.Tizen/TizenIsolatedStorageFile.cs b/Xamarin.Forms.Platform.Tizen/TizenIsolatedStorageFile.cs index 0550d9d..ec50c8a 100644 --- a/Xamarin.Forms.Platform.Tizen/TizenIsolatedStorageFile.cs +++ b/Xamarin.Forms.Platform.Tizen/TizenIsolatedStorageFile.cs @@ -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 OpenFileAsync(string path, FileMode mode, FileAccess access) + public Task OpenFileAsync(string path, Internals.FileMode mode, Internals.FileAccess access) { return Task.FromResult(OpenFile(path, (System.IO.FileMode)mode, (System.IO.FileAccess)access)); } - public Task OpenFileAsync(string path, FileMode mode, FileAccess access, FileShare share) + public Task 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)); }