summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8
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.Platform.WP8
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.Platform.WP8')
-rw-r--r--Xamarin.Forms.Platform.WP8/LabelRenderer.cs5
-rw-r--r--Xamarin.Forms.Platform.WP8/Platform.cs8
-rw-r--r--Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs2
-rw-r--r--Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj18
4 files changed, 23 insertions, 10 deletions
diff --git a/Xamarin.Forms.Platform.WP8/LabelRenderer.cs b/Xamarin.Forms.Platform.WP8/LabelRenderer.cs
index 86c68ad..fbb3f9c 100644
--- a/Xamarin.Forms.Platform.WP8/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/LabelRenderer.cs
@@ -24,8 +24,9 @@ namespace Xamarin.Forms.Platform.WinPhone
run.Foreground = span.ForegroundColor.ToBrush();
if (!span.IsDefault())
+#pragma warning disable 618
run.ApplyFont(span.Font);
-
+#pragma warning restore 618
return run;
}
}
@@ -121,7 +122,9 @@ namespace Xamarin.Forms.Platform.WinPhone
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.WP8/Platform.cs b/Xamarin.Forms.Platform.WP8/Platform.cs
index 4626542..84a3e76 100644
--- a/Xamarin.Forms.Platform.WP8/Platform.cs
+++ b/Xamarin.Forms.Platform.WP8/Platform.cs
@@ -475,7 +475,9 @@ namespace Xamarin.Forms.Platform.WinPhone
foreach (Page f in _navModel.Roots)
{
f.Layout(new Rectangle(0, 0, _renderer.ActualWidth, _renderer.ActualHeight));
+#pragma warning disable 618
IVisualElementRenderer pageRenderer = f.GetRenderer();
+#pragma warning restore 618
if (pageRenderer != null)
{
((FrameworkElement)pageRenderer.ContainerElement).Width = _renderer.ActualWidth;
@@ -540,7 +542,9 @@ namespace Xamarin.Forms.Platform.WinPhone
var button = new TaggedAppBarButton
{
IconUri = new Uri(item.Icon ?? "ApplicationIcon.jpg", UriKind.Relative),
+#pragma warning disable 618
Text = !string.IsNullOrWhiteSpace(item.Name) ? item.Text : (string)item.Icon ?? "ApplicationIcon.jpg",
+#pragma warning restore 618
IsEnabled = item.IsEnabled,
Tag = item
};
@@ -554,7 +558,9 @@ namespace Xamarin.Forms.Platform.WinPhone
if (_page.ApplicationBar.MenuItems.OfType<TaggedAppBarMenuItem>().Any(b => b.Tag == item))
continue;
+#pragma warning disable 618
var button = new TaggedAppBarMenuItem { Text = !string.IsNullOrWhiteSpace(item.Name) ? item.Text : (string)item.Icon ?? "MenuItem", IsEnabled = true, Tag = item };
+#pragma warning restore 618
button.Click += (sender, args) => item.Activate();
menuItemsToAdd.Add(button);
}
@@ -624,7 +630,9 @@ namespace Xamarin.Forms.Platform.WinPhone
if (e.PropertyName == MenuItem.IsEnabledProperty.PropertyName)
IsEnabled = item.IsEnabled;
else if (e.PropertyName == MenuItem.TextProperty.PropertyName)
+#pragma warning disable 618
Text = !string.IsNullOrWhiteSpace(item.Name) ? item.Text : (string)item.Icon ?? "ApplicationIcon.jpg";
+#pragma warning restore 618
else if (e.PropertyName == MenuItem.IconProperty.PropertyName)
IconUri = new Uri(item.Icon ?? "ApplicationIcon.jpg", UriKind.Relative);
}
diff --git a/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs b/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs
index 9ec274c..27e3799 100644
--- a/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs
@@ -144,7 +144,9 @@ namespace Xamarin.Forms.Platform.WinPhone
var child = Element.LogicalChildren[i] as VisualElement;
if (child == null)
continue;
+#pragma warning disable 618
IVisualElementRenderer renderer = child.GetRenderer();
+#pragma warning restore 618
if (renderer == null)
continue;
Rectangle bounds = child.Bounds;
diff --git a/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj b/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj
index c615ba4..6036a1a 100644
--- a/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj
+++ b/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj
@@ -32,7 +32,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0219</NoWarn>
+ <NoWarn>0219</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -44,7 +44,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;4014;0618;0219;0067</NoWarn>
+ <NoWarn>0114;4014;0219;0067</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
@@ -56,7 +56,7 @@
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <NoWarn>0114;4014;0618;0219;0067</NoWarn>
+ <NoWarn>0114;4014;0219;0067</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
@@ -68,7 +68,7 @@
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <NoWarn>0114;4014;0618;0219;0067</NoWarn>
+ <NoWarn>0114;4014;0219;0067</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
@@ -81,7 +81,7 @@
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <NoWarn>0114;4014;0618;0219;0067</NoWarn>
+ <NoWarn>0114;4014;0219;0067</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
@@ -93,7 +93,7 @@
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <NoWarn>0114;4014;0618;0219;0067</NoWarn>
+ <NoWarn>0114;4014;0219;0067</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
@@ -106,7 +106,7 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;4014;0618;0219;0067</NoWarn>
+ <NoWarn>0114;4014;0219;0067</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|x86'">
<DebugSymbols>true</DebugSymbols>
@@ -117,7 +117,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
- <NoWarn>0114;4014;0618;0219;0067</NoWarn>
+ <NoWarn>0114;4014;0219;0067</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|ARM'">
@@ -129,7 +129,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
- <NoWarn>0114;4014;0618;0219;0067</NoWarn>
+ <NoWarn>0114;4014;0219;0067</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>