From 10f6c08ceb89b8b302cb41dd6fe7b1ccf70884ba Mon Sep 17 00:00:00 2001 From: kingces95 Date: Tue, 12 Apr 2016 11:44:30 -0700 Subject: [PATCH] Mop up enabling warnings as errors (#78) --- Xamarin.Forms.Core/Cells/EntryCell.cs | 2 ++ Xamarin.Forms.Core/Label.cs | 16 ++++++++++++++++ Xamarin.Forms.Core/Span.cs | 2 ++ Xamarin.Forms.Core/TapGestureRecognizer.cs | 2 ++ Xamarin.Forms.Core/TypeConverter.cs | 2 ++ Xamarin.Forms.Core/VisualElement.cs | 6 ++++++ Xamarin.Forms.Core/Xamarin.Forms.Core.csproj | 9 ++++++--- Xamarin.Forms.Maps.Android/MapRenderer.cs | 2 +- .../Xamarin.Forms.Maps.Android.csproj | 9 ++++++--- Xamarin.Forms.Maps.UWP/MapRenderer.cs | 2 ++ Xamarin.Forms.Maps.UWP/Xamarin.Forms.Maps.UWP.csproj | 6 ++++-- .../Xamarin.Forms.Maps.WinRT.Phone.csproj | 6 ++++-- Xamarin.Forms.Maps.WinRT.Tablet/MapRenderer.cs | 2 ++ .../Xamarin.Forms.Maps.WinRT.Tablet.csproj | 6 ++++-- .../Xamarin.Forms.Maps.iOS.Classic.csproj | 12 ++++++++---- Xamarin.Forms.Maps.iOS/Xamarin.Forms.Maps.iOS.csproj | 12 ++++++++---- .../Xamarin.Forms.Platform.UAP.csproj | 4 ++-- Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs | 2 -- .../Xamarin.Forms.Platform.WinRT.csproj | 4 ++-- 19 files changed, 79 insertions(+), 27 deletions(-) diff --git a/Xamarin.Forms.Core/Cells/EntryCell.cs b/Xamarin.Forms.Core/Cells/EntryCell.cs index d74e365..cccdcae 100644 --- a/Xamarin.Forms.Core/Cells/EntryCell.cs +++ b/Xamarin.Forms.Core/Cells/EntryCell.cs @@ -74,7 +74,9 @@ namespace Xamarin.Forms static void OnHorizontalTextAlignmentPropertyChanged(BindableObject bindable, object oldValue, object newValue) { var label = (EntryCell)bindable; +#pragma warning disable 0618 // retain until XAlign removed label.OnPropertyChanged(nameof(XAlign)); +#pragma warning restore } } } \ No newline at end of file diff --git a/Xamarin.Forms.Core/Label.cs b/Xamarin.Forms.Core/Label.cs index fed021f..d34f117 100644 --- a/Xamarin.Forms.Core/Label.cs +++ b/Xamarin.Forms.Core/Label.cs @@ -176,11 +176,15 @@ namespace Xamarin.Forms var family = (string)values[0]; if (family != null) { +#pragma warning disable 0618 // retain until Font removed label.Font = Font.OfSize(family, (double)values[1]).WithAttributes(attributes); +#pragma warning restore } else { +#pragma warning disable 0618 // retain until Font removed label.Font = Font.SystemFontOfSize((double)values[1], attributes); +#pragma warning restore } label._cancelEvents = false; @@ -201,11 +205,15 @@ namespace Xamarin.Forms var family = (string)newValue; if (family != null) { +#pragma warning disable 0618 // retain until Font removed label.Font = Font.OfSize(family, (double)values[0]).WithAttributes((FontAttributes)values[1]); +#pragma warning restore } else { +#pragma warning disable 0618 // retain until Font removed label.Font = Font.SystemFontOfSize((double)values[0], (FontAttributes)values[1]); +#pragma warning restore } label._cancelEvents = false; @@ -226,11 +234,15 @@ namespace Xamarin.Forms var family = (string)values[0]; if (family != null) { +#pragma warning disable 0618 // retain until Font removed label.Font = Font.OfSize(family, size).WithAttributes((FontAttributes)values[1]); +#pragma warning restore } else { +#pragma warning disable 0618 // retain until Font removed label.Font = Font.SystemFontOfSize(size, (FontAttributes)values[1]); +#pragma warning restore } label._cancelEvents = false; @@ -246,7 +258,9 @@ namespace Xamarin.Forms static void OnHorizontalTextAlignmentPropertyChanged(BindableObject bindable, object oldValue, object newValue) { var label = (Label)bindable; +#pragma warning disable 0618 // retain until XAlign removed label.OnPropertyChanged(nameof(XAlign)); +#pragma warning restore } static void OnTextPropertyChanged(BindableObject bindable, object oldvalue, object newvalue) @@ -264,7 +278,9 @@ namespace Xamarin.Forms static void OnVerticalTextAlignmentPropertyChanged(BindableObject bindable, object oldValue, object newValue) { var label = (Label)bindable; +#pragma warning disable 0618 // retain until YAlign removed label.OnPropertyChanged(nameof(YAlign)); +#pragma warning restore } } } \ No newline at end of file diff --git a/Xamarin.Forms.Core/Span.cs b/Xamarin.Forms.Core/Span.cs index 3789ddf..6ffc3f1 100644 --- a/Xamarin.Forms.Core/Span.cs +++ b/Xamarin.Forms.Core/Span.cs @@ -126,6 +126,7 @@ namespace Xamarin.Forms handler(this, new PropertyChangedEventArgs(propertyName)); } +#pragma warning disable 0618 // retain until Span.Font removed void UpdateFontPropertiesFromStruct() { if (_inUpdate) @@ -166,4 +167,5 @@ namespace Xamarin.Forms _inUpdate = false; } } +#pragma warning restore } \ No newline at end of file diff --git a/Xamarin.Forms.Core/TapGestureRecognizer.cs b/Xamarin.Forms.Core/TapGestureRecognizer.cs index 0489985..8449f10 100644 --- a/Xamarin.Forms.Core/TapGestureRecognizer.cs +++ b/Xamarin.Forms.Core/TapGestureRecognizer.cs @@ -45,9 +45,11 @@ namespace Xamarin.Forms if (handler != null) handler(sender, new TappedEventArgs(CommandParameter)); +#pragma warning disable 0618 // retain until TappedCallback removed Action callback = TappedCallback; if (callback != null) callback(sender, TappedCallbackParameter); +#pragma warning restore } #region obsolete cruft diff --git a/Xamarin.Forms.Core/TypeConverter.cs b/Xamarin.Forms.Core/TypeConverter.cs index 7bbf221..57ea3b4 100644 --- a/Xamarin.Forms.Core/TypeConverter.cs +++ b/Xamarin.Forms.Core/TypeConverter.cs @@ -27,7 +27,9 @@ namespace Xamarin.Forms public virtual object ConvertFromInvariantString(string value) { +#pragma warning disable 0618 // retain until ConvertFrom removed return ConvertFrom(CultureInfo.InvariantCulture, value); +#pragma warning restore } } } \ No newline at end of file diff --git a/Xamarin.Forms.Core/VisualElement.cs b/Xamarin.Forms.Core/VisualElement.cs index 16efe73..c85b379 100644 --- a/Xamarin.Forms.Core/VisualElement.cs +++ b/Xamarin.Forms.Core/VisualElement.cs @@ -511,7 +511,9 @@ namespace Xamarin.Forms public SizeRequest Measure(double widthConstraint, double heightConstraint, MeasureFlags flags = MeasureFlags.None) { +#pragma warning disable 0618 // retain until GetSizeRequest removed SizeRequest result = GetSizeRequest(widthConstraint, heightConstraint); +#pragma warning restore if ((flags & MeasureFlags.IncludeMargins) != 0) { @@ -577,11 +579,14 @@ namespace Xamarin.Forms protected virtual SizeRequest OnMeasure(double widthConstraint, double heightConstraint) { +#pragma warning disable 0618 // retain until OnSizeRequest removed return OnSizeRequest(widthConstraint, heightConstraint); +#pragma warning restore } protected override void OnParentSet() { +#pragma warning disable 0618 // retain until ParentView removed base.OnParentSet(); if (ParentView != null) @@ -592,6 +597,7 @@ namespace Xamarin.Forms { NavigationProxy.Inner = null; } +#pragma warning restore } protected virtual void OnSizeAllocated(double width, double height) diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj index 139c261..70d721d 100644 --- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj +++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj @@ -22,7 +22,8 @@ 4 false true - 0618 + + full @@ -32,14 +33,16 @@ 4 false true - 0618 + + true bin\Turkey\ DEBUG; true - 0618 + + full AnyCPU prompt diff --git a/Xamarin.Forms.Maps.Android/MapRenderer.cs b/Xamarin.Forms.Maps.Android/MapRenderer.cs index 9aa1c00..a0a3bbc 100644 --- a/Xamarin.Forms.Maps.Android/MapRenderer.cs +++ b/Xamarin.Forms.Maps.Android/MapRenderer.cs @@ -260,7 +260,7 @@ namespace Xamarin.Forms.Maps.Android return; foreach (Pin p in pins) { - var marker = _markers.FirstOrDefault (m => m.Id == p.Id); + var marker = _markers.FirstOrDefault (m => (object)m.Id == p.Id); if (marker == null) continue; marker.Remove (); diff --git a/Xamarin.Forms.Maps.Android/Xamarin.Forms.Maps.Android.csproj b/Xamarin.Forms.Maps.Android/Xamarin.Forms.Maps.Android.csproj index 8f0fad9..66f81ec 100644 --- a/Xamarin.Forms.Maps.Android/Xamarin.Forms.Maps.Android.csproj +++ b/Xamarin.Forms.Maps.Android/Xamarin.Forms.Maps.Android.csproj @@ -28,7 +28,8 @@ prompt 4 true - 0253 + + pdbonly @@ -38,7 +39,8 @@ prompt 4 true - 0253 + + true @@ -51,7 +53,8 @@ 4 false true - 0253 + + diff --git a/Xamarin.Forms.Maps.UWP/MapRenderer.cs b/Xamarin.Forms.Maps.UWP/MapRenderer.cs index 4d3564e..f8a4c87 100644 --- a/Xamarin.Forms.Maps.UWP/MapRenderer.cs +++ b/Xamarin.Forms.Maps.UWP/MapRenderer.cs @@ -133,7 +133,9 @@ namespace Xamarin.Forms.Maps.WinRT void ClearPins() { Control.Children.Clear(); +#pragma warning disable 4014 // don't wanna block UI thread UpdateIsShowingUser(); +#pragma warning restore } void RemovePin(Pin pinToRemove) diff --git a/Xamarin.Forms.Maps.UWP/Xamarin.Forms.Maps.UWP.csproj b/Xamarin.Forms.Maps.UWP/Xamarin.Forms.Maps.UWP.csproj index 92108fe..654f773 100644 --- a/Xamarin.Forms.Maps.UWP/Xamarin.Forms.Maps.UWP.csproj +++ b/Xamarin.Forms.Maps.UWP/Xamarin.Forms.Maps.UWP.csproj @@ -27,7 +27,8 @@ prompt 4 true - 4014 + + AnyCPU @@ -38,7 +39,8 @@ prompt 4 true - 4014 + + x86 diff --git a/Xamarin.Forms.Maps.WinRT.Phone/Xamarin.Forms.Maps.WinRT.Phone.csproj b/Xamarin.Forms.Maps.WinRT.Phone/Xamarin.Forms.Maps.WinRT.Phone.csproj index 186e152..7bedda1 100644 --- a/Xamarin.Forms.Maps.WinRT.Phone/Xamarin.Forms.Maps.WinRT.Phone.csproj +++ b/Xamarin.Forms.Maps.WinRT.Phone/Xamarin.Forms.Maps.WinRT.Phone.csproj @@ -26,7 +26,8 @@ prompt 4 true - 4014 + + pdbonly @@ -36,7 +37,8 @@ prompt 4 true - 4014 + + true diff --git a/Xamarin.Forms.Maps.WinRT.Tablet/MapRenderer.cs b/Xamarin.Forms.Maps.WinRT.Tablet/MapRenderer.cs index b3eba8a..bb3a0da 100644 --- a/Xamarin.Forms.Maps.WinRT.Tablet/MapRenderer.cs +++ b/Xamarin.Forms.Maps.WinRT.Tablet/MapRenderer.cs @@ -110,7 +110,9 @@ namespace Xamarin.Forms.Maps.WinRT void ClearPins() { Control.Children.Clear(); +#pragma warning disable 4014 // don't wanna block UI thread UpdateIsShowingUser(); +#pragma warning restore } void RemovePin(Pin pinToRemove) diff --git a/Xamarin.Forms.Maps.WinRT.Tablet/Xamarin.Forms.Maps.WinRT.Tablet.csproj b/Xamarin.Forms.Maps.WinRT.Tablet/Xamarin.Forms.Maps.WinRT.Tablet.csproj index 78678de..d8c0c99 100644 --- a/Xamarin.Forms.Maps.WinRT.Tablet/Xamarin.Forms.Maps.WinRT.Tablet.csproj +++ b/Xamarin.Forms.Maps.WinRT.Tablet/Xamarin.Forms.Maps.WinRT.Tablet.csproj @@ -42,7 +42,8 @@ true bin\ARM\Debug\ DEBUG;TRACE;NETFX_CORE;WINDOWS_APP - 2008;4014 + + full ARM false @@ -54,7 +55,8 @@ bin\ARM\Release\ TRACE;NETFX_CORE;WINDOWS_APP true - 2008;4014 + + pdbonly ARM false diff --git a/Xamarin.Forms.Maps.iOS/Xamarin.Forms.Maps.iOS.Classic.csproj b/Xamarin.Forms.Maps.iOS/Xamarin.Forms.Maps.iOS.Classic.csproj index 78f3581..0f5fb89 100644 --- a/Xamarin.Forms.Maps.iOS/Xamarin.Forms.Maps.iOS.Classic.csproj +++ b/Xamarin.Forms.Maps.iOS/Xamarin.Forms.Maps.iOS.Classic.csproj @@ -25,7 +25,8 @@ true iPhone Developer true - 0414 + + none @@ -37,7 +38,8 @@ false iPhone Developer true - 0414 + + true @@ -49,11 +51,13 @@ prompt MinimumRecommendedRules.ruleset true - 0414 + + true - 0414 + + diff --git a/Xamarin.Forms.Maps.iOS/Xamarin.Forms.Maps.iOS.csproj b/Xamarin.Forms.Maps.iOS/Xamarin.Forms.Maps.iOS.csproj index 0606872..0318b39 100644 --- a/Xamarin.Forms.Maps.iOS/Xamarin.Forms.Maps.iOS.csproj +++ b/Xamarin.Forms.Maps.iOS/Xamarin.Forms.Maps.iOS.csproj @@ -24,7 +24,8 @@ true iPhone Developer true - 0414 + + none @@ -35,7 +36,8 @@ false iPhone Developer true - 0414 + + true @@ -47,11 +49,13 @@ prompt MinimumRecommendedRules.ruleset true - 0414 + + true - 0414 + + diff --git a/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj b/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj index ff9775e..d0781af 100644 --- a/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj +++ b/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj @@ -27,7 +27,7 @@ prompt 4 true - 1998;0618;0169 + 1998 AnyCPU @@ -38,7 +38,7 @@ prompt 4 true - 1998;0618;0169 + 1998 ARM diff --git a/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs b/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs index 47ff326..05e3f93 100644 --- a/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs +++ b/Xamarin.Forms.Platform.WinRT/ListViewRenderer.cs @@ -165,8 +165,6 @@ namespace Xamarin.Forms.Platform.WinRT sealed class BrushedElement { - bool _isBound; - public BrushedElement(FrameworkElement element, WBinding brushBinding = null, Brush brush = null) { Element = element; diff --git a/Xamarin.Forms.Platform.WinRT/Xamarin.Forms.Platform.WinRT.csproj b/Xamarin.Forms.Platform.WinRT/Xamarin.Forms.Platform.WinRT.csproj index 266d91e..34a62fa 100644 --- a/Xamarin.Forms.Platform.WinRT/Xamarin.Forms.Platform.WinRT.csproj +++ b/Xamarin.Forms.Platform.WinRT/Xamarin.Forms.Platform.WinRT.csproj @@ -37,7 +37,7 @@ prompt 4 true - 1998;0168;0169;0067;0618 + 1998 pdbonly @@ -47,7 +47,7 @@ prompt 4 true - 1998;0168;0169;0067;0618 + 1998 -- 2.7.4