summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Maps.Android
diff options
context:
space:
mode:
authorPaul DiPietro <paul.dipietro@me.com>2016-04-11 16:50:28 (GMT)
committerJason Smith <jason.smith@xamarin.com>2016-04-11 16:50:28 (GMT)
commitb2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c (patch)
tree227d1614c84e3d2dbe7f6231276955a6a174ff6d /Xamarin.Forms.Maps.Android
parentc0468f1cc33fc4dc415c3a3ca4dc71986b04fc9c (diff)
downloadxamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.zip
xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.gz
xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.bz2
Enable CS0618 warnings as errors (#72)
CS0618 occurs when using an obsolete property or method. https://msdn.microsoft.com/en-us/library/x5ye6x1e.aspx
Diffstat (limited to 'Xamarin.Forms.Maps.Android')
-rw-r--r--Xamarin.Forms.Maps.Android/FormsMaps.cs2
-rw-r--r--Xamarin.Forms.Maps.Android/MapRenderer.cs7
-rw-r--r--Xamarin.Forms.Maps.Android/Xamarin.Forms.Maps.Android.csproj6
3 files changed, 12 insertions, 3 deletions
diff --git a/Xamarin.Forms.Maps.Android/FormsMaps.cs b/Xamarin.Forms.Maps.Android/FormsMaps.cs
index 76fc48d..343a30d 100644
--- a/Xamarin.Forms.Maps.Android/FormsMaps.cs
+++ b/Xamarin.Forms.Maps.Android/FormsMaps.cs
@@ -24,7 +24,9 @@ namespace Xamarin
MapRenderer.Bundle = bundle;
+#pragma warning disable 618
if (GooglePlayServicesUtil.IsGooglePlayServicesAvailable(Context) == ConnectionResult.Success)
+#pragma warning restore 618
{
try
{
diff --git a/Xamarin.Forms.Maps.Android/MapRenderer.cs b/Xamarin.Forms.Maps.Android/MapRenderer.cs
index 20cb122..9aa1c00 100644
--- a/Xamarin.Forms.Maps.Android/MapRenderer.cs
+++ b/Xamarin.Forms.Maps.Android/MapRenderer.cs
@@ -30,7 +30,9 @@ namespace Xamarin.Forms.Maps.Android
const string MoveMessageName = "MapMoveToRegion";
+#pragma warning disable 618
protected GoogleMap NativeMap => ((MapView) Control).Map;
+#pragma warning restore 618
protected Map Map => (Map) Element;
@@ -56,8 +58,13 @@ namespace Xamarin.Forms.Maps.Android
MessagingCenter.Unsubscribe<Map, MapSpan> (this, MoveMessageName);
+#pragma warning disable 618
if (oldMapView.Map != null) {
+#pragma warning restore 618
+
+#pragma warning disable 618
oldMapView.Map.SetOnCameraChangeListener (null);
+#pragma warning restore 618
NativeMap.InfoWindowClick -= MapOnMarkerClick;
}
diff --git a/Xamarin.Forms.Maps.Android/Xamarin.Forms.Maps.Android.csproj b/Xamarin.Forms.Maps.Android/Xamarin.Forms.Maps.Android.csproj
index 0d0e1dc..8f0fad9 100644
--- a/Xamarin.Forms.Maps.Android/Xamarin.Forms.Maps.Android.csproj
+++ b/Xamarin.Forms.Maps.Android/Xamarin.Forms.Maps.Android.csproj
@@ -28,7 +28,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0253</NoWarn>
+ <NoWarn>0253</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -38,7 +38,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0253</NoWarn>
+ <NoWarn>0253</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
@@ -51,7 +51,7 @@
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0253</NoWarn>
+ <NoWarn>0253</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />