diff options
author | Paul DiPietro <paul.dipietro@me.com> | 2016-04-11 09:50:28 -0700 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-04-11 09:50:28 -0700 |
commit | b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c (patch) | |
tree | 227d1614c84e3d2dbe7f6231276955a6a174ff6d /Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs | |
parent | c0468f1cc33fc4dc415c3a3ca4dc71986b04fc9c (diff) | |
download | xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.gz xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.bz2 xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.zip |
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.Controls/GalleryPages/LabelGallery.cs')
-rw-r--r-- | Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs b/Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs index 65210969..c40d7ae4 100644 --- a/Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs +++ b/Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs @@ -36,32 +36,68 @@ namespace Xamarin.Forms.Controls }; var formatted = new Label { FormattedText = new FormattedString { Spans = { +#pragma warning disable 618 new Span {Text="FormattedStrings ", ForegroundColor=Color.Blue, BackgroundColor = Color.Yellow, Font = Font.BoldSystemFontOfSize (NamedSize.Large)}, +#pragma warning restore 618 new Span {Text="are ", ForegroundColor=Color.Red, BackgroundColor = Color.Gray}, new Span {Text="not pretty!", ForegroundColor = Color.Green,}, } } }; var missingfont = new Label { Text = "Missing font: use default" }; +#pragma warning disable 618 micro.Font = Font.SystemFontOfSize (NamedSize.Micro); +#pragma warning restore 618 + +#pragma warning disable 618 small.Font = Font.SystemFontOfSize (NamedSize.Small); +#pragma warning restore 618 + +#pragma warning disable 618 medium.Font = Font.SystemFontOfSize (NamedSize.Medium); +#pragma warning restore 618 + +#pragma warning disable 618 large.Font = Font.SystemFontOfSize (NamedSize.Large); +#pragma warning restore 618 +#pragma warning disable 618 bold.Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold); +#pragma warning restore 618 + +#pragma warning disable 618 italic.Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Italic); +#pragma warning restore 618 + +#pragma warning disable 618 bolditalic.Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold | FontAttributes.Italic); +#pragma warning restore 618 var fontName = Device.OnPlatform ("Georgia", "sans-serif-light", "Comic Sans MS"); var font = Font.OfSize (fontName, NamedSize.Medium); +#pragma warning disable 618 customFont.Font = font; +#pragma warning restore 618 + +#pragma warning disable 618 italicfont.Font = font.WithAttributes (FontAttributes.Italic); +#pragma warning restore 618 + +#pragma warning disable 618 boldfont.Font = font.WithAttributes (FontAttributes.Bold); +#pragma warning restore 618 + +#pragma warning disable 618 bolditalicfont.Font = font.WithAttributes (FontAttributes.Bold | FontAttributes.Italic); +#pragma warning restore 618 +#pragma warning disable 618 customFont.GestureRecognizers.Add (new TapGestureRecognizer{Command = new Command (o => customFont.Font = Font.Default)}); +#pragma warning restore 618 +#pragma warning disable 618 missingfont.Font = Font.OfSize ("FooBar", 20); +#pragma warning restore 618 center.HorizontalTextAlignment = TextAlignment.Center; right.HorizontalTextAlignment = TextAlignment.End; int i = 1; |