From b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c Mon Sep 17 00:00:00 2001 From: Paul DiPietro Date: Mon, 11 Apr 2016 09:50:28 -0700 Subject: Enable CS0618 warnings as errors (#72) CS0618 occurs when using an obsolete property or method. https://msdn.microsoft.com/en-us/library/x5ye6x1e.aspx --- Xamarin.Forms.Platform.WinRT/LabelRenderer.cs | 4 ++++ Xamarin.Forms.Platform.WinRT/VisualElementExtensions.cs | 2 ++ Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs | 2 ++ 3 files changed, 8 insertions(+) (limited to 'Xamarin.Forms.Platform.WinRT') diff --git a/Xamarin.Forms.Platform.WinRT/LabelRenderer.cs b/Xamarin.Forms.Platform.WinRT/LabelRenderer.cs index 41a0b477..cb33cde9 100644 --- a/Xamarin.Forms.Platform.WinRT/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.WinRT/LabelRenderer.cs @@ -23,7 +23,9 @@ namespace Xamarin.Forms.Platform.WinRT run.Foreground = span.ForegroundColor.ToBrush(); if (!span.IsDefault()) +#pragma warning disable 618 run.ApplyFont(span.Font); +#pragma warning restore 618 return run; } @@ -131,7 +133,9 @@ namespace Xamarin.Forms.Platform.WinRT if (label == null || (label.IsDefault() && !_fontApplied)) return; +#pragma warning disable 618 Font fontToApply = label.IsDefault() ? Font.SystemFontOfSize(NamedSize.Medium) : label.Font; +#pragma warning restore 618 textBlock.ApplyFont(fontToApply); _fontApplied = true; diff --git a/Xamarin.Forms.Platform.WinRT/VisualElementExtensions.cs b/Xamarin.Forms.Platform.WinRT/VisualElementExtensions.cs index 9dfd12bb..79688693 100644 --- a/Xamarin.Forms.Platform.WinRT/VisualElementExtensions.cs +++ b/Xamarin.Forms.Platform.WinRT/VisualElementExtensions.cs @@ -18,7 +18,9 @@ namespace Xamarin.Forms.Platform.WinRT IVisualElementRenderer renderer = Platform.GetRenderer(self); if (renderer == null) { +#pragma warning disable 618 renderer = RendererFactory.CreateRenderer(self); +#pragma warning restore 618 Platform.SetRenderer(self, renderer); } diff --git a/Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs b/Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs index 8074f3f1..df367f7c 100644 --- a/Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs +++ b/Xamarin.Forms.Platform.WinRT/WebViewRenderer.cs @@ -96,7 +96,9 @@ namespace Xamarin.Forms.Platform.WinRT async void OnEvalRequested(object sender, EventArg eventArg) { +#pragma warning disable 618 await Control.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => Control.InvokeScript("eval", new[] { eventArg.Data })); +#pragma warning restore 618 } void OnGoBackRequested(object sender, EventArgs eventArgs) -- cgit v1.2.3