CS0618 occurs when using an obsolete property or method.
https://msdn.microsoft.com/en-us/library/x5ye6x1e.aspx
if (member.DeclaringType.BaseType != null) {
var baseTypeRef = member.DeclaringType.BaseType;
while (baseTypeRef != null) {
+#pragma warning disable 618
var baseType = baseTypeRef.ResolveOrThrow();
+#pragma warning restore 618
if (baseType.HasProperties && AnyIsHiddenBy(baseType.Properties, member, m => !m.IsIndexer()))
return true;
if (baseType.HasEvents && AnyIsHiddenBy(baseType.Events, member))
var baseType = type.Item.BaseType;
var genericBaseType = baseType as GenericInstanceType;
if (genericBaseType != null) {
+#pragma warning disable 618
type = new GenericContext<TypeDefinition>(genericBaseType.ResolveOrThrow(),
+#pragma warning restore 618
genericBaseType.GenericArguments.Select(t => type.ResolveWithContext(t)));
} else
+#pragma warning disable 618
type = new GenericContext<TypeDefinition>(baseType.ResolveOrThrow());
+#pragma warning restore 618
yield return type;
}
}
var resolvedElementType = ResolveWithContext(typeSpecification.ElementType);
return ReplaceElementType(typeSpecification, resolvedElementType);
}
+#pragma warning disable 618
return type.ResolveOrThrow();
+#pragma warning restore 618
}
TypeReference ReplaceElementType(TypeSpecification ts, TypeReference newElementType)
return new ByReferenceType(newElementType);
}
// TODO: should we throw an exception instead calling Resolve method?
+#pragma warning disable 618
return ts.ResolveOrThrow();
+#pragma warning restore 618
}
public GenericContext<T2> ApplyTo<T2>(T2 item) where T2 : class
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0219;0414</NoWarn>
+ <NoWarn>0219;0414</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0219;0414</NoWarn>
+ <NoWarn>0219;0414</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
public CustomViewCell ()
{
var jobId = new Label {
+#pragma warning disable 618
Font = Font.SystemFontOfSize(20),
+#pragma warning restore 618
WidthRequest = 105,
VerticalOptions = LayoutOptions.Center,
var hours = new Label {
WidthRequest = 45,
VerticalOptions = LayoutOptions.Center,
+#pragma warning disable 618
XAlign = TextAlignment.End,
+#pragma warning restore 618
HorizontalOptions = LayoutOptions.EndAndExpand,
};
VerticalOptions = LayoutOptions.FillAndExpand,
Children = {
new Label {
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
Text = "Tap input field, then try to scroll"
},
new WebView {
for (var i = 0; i < 100; i++)
sb.Append ("View 1a with ScrollView +++ ");
+#pragma warning disable 618
var label = new Label { Text = sb.ToString (), HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, XAlign = TextAlignment.Center, };
+#pragma warning restore 618
scrollView.Content = label;
for (var i = 0; i < 50; i++)
sb.Append ("View 1b with ScrollView and recreation of content +++++ ");
+#pragma warning disable 618
var label = new Label { Text = sb.ToString (), HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, XAlign = TextAlignment.Center, };
+#pragma warning restore 618
scrollView.Content = label;
public View2 ()
{
BackgroundColor = Color.Teal;
+#pragma warning disable 618
Content = new Label { Text = "View 2", HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, XAlign = TextAlignment.Center, };
+#pragma warning restore 618
}
}
listview.Header = new Label () {
Text = _header,
TextColor = Color.Red,
+#pragma warning disable 618
XAlign = TextAlignment.Center
+#pragma warning restore 618
};
var b = new Button () {
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
Text = "Welcome to Xamarin Forms!"
},
new Button {
var page1Layout = new StackLayout {
Children = {
new Label {
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
Text = "Page 1"
}
}
var page2Layout = new StackLayout {
Children = {
new Label {
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
Text = "Page 2"
}
}
Content = new StackLayout {
Children = {
btn,
+#pragma warning disable 618
new Label {Text = "GeneratedImage", Font=Font.BoldSystemFontOfSize(NamedSize.Medium)},
+#pragma warning restore 618
generatedImage
},
Padding = new Thickness (0, 20, 0, 0),
_secondaryLabel = new Label() { HeightRequest = 40, FontSize = 16, TranslationY = -5, LineBreakMode = LineBreakMode.TailTruncation };
_secondaryLabel.SetBinding(Label.TextProperty, "SecondaryLabelText");
+#pragma warning disable 618
_distanceLabel = new Label() { XAlign = TextAlignment.End, HorizontalOptions = LayoutOptions.EndAndExpand, FontSize = 11, LineBreakMode = LineBreakMode.NoWrap };
+#pragma warning restore 618
_distanceLabel.SetBinding(Label.TextProperty, "OtherLabelText");
_statusCircle = new Label()
var stack = new StackLayout () { VerticalOptions = LayoutOptions.Center };
stack.Children.Add (new Label () { VerticalOptions =
+#pragma warning disable 618
LayoutOptions.Center, XAlign = TextAlignment.Center, Text = "Page 1"
+#pragma warning restore 618
});
Content = stack;
};
var entryCell = new EntryCell { Text = "yaddayadda" };
+#pragma warning disable 618
entryCell.XAlign = TextAlignment.End;
+#pragma warning restore 618
entryCell.Label = "Click Here";
entryCell.Tapped += (s, e) =>
{
protected override void Init ()
{
+#pragma warning disable 618
var label = new Label () { XAlign = TextAlignment.Center };
+#pragma warning restore 618
var image = new Image ();
image.PropertyChanged += (sender, e) => {
stack.Children.Add (new Label () {
VerticalOptions = LayoutOptions.Center,
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
Text = "Page 1"
});
void NewMenuItem_Clicked (object sender, EventArgs e)
{
+#pragma warning disable 618
ParentView.Navigation.PushAsync (new NextPage (), false);
+#pragma warning restore 618
}
}
Label header = new Label
{
Text = "Should not see blue",
+#pragma warning disable 618
Font = Font.BoldSystemFontOfSize(40),
+#pragma warning restore 618
HorizontalOptions = LayoutOptions.Center,
TextColor = Color.Black
};
if (s_mImgRenewal == null)
s_mImgRenewal = ImageSource.FromFile ("bank.png");
+#pragma warning disable 618
var label1 = new Label { Text = "Label 1", Font = Font.SystemFontOfSize (NamedSize.Small, FontAttributes.Bold) };
+#pragma warning restore 618
label1.SetBinding (Label.TextProperty, new Binding ("."));
+#pragma warning disable 618
var label2 = new Label { Text = "Label 2", Font = Font.SystemFontOfSize (NamedSize.Small) };
+#pragma warning restore 618
// was ListButton?
var button = new Button {
button.Clicked += (sender, e) => {
var b = (Button) sender;
var t = b.CommandParameter;
+#pragma warning disable 618
((ContentPage) ((ListView) ((StackLayout) b.ParentView).ParentView).ParentView).DisplayAlert ("Clicked",
+#pragma warning restore 618
t + " button was clicked", "OK");
Debug.WriteLine ("clicked" + t);
};
new Label {
Text = "by subscribing, you accept the general conditions.",
TextColor = Color.White,
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Micro),
+#pragma warning restore 618
WidthRequest = 262,
HorizontalOptions = LayoutOptions.Center,
},
Label header = new Label
{
Text = "Picker",
+#pragma warning disable 618
Font = Font.BoldSystemFontOfSize(50),
+#pragma warning restore 618
HorizontalOptions = LayoutOptions.Center
};
grid.Children.Add (label = new Label (),0,1);
label.SetBinding (Label.TextProperty, "LastName");
+#pragma warning disable 618
grid.Children.Add (label = new Label {XAlign = TextAlignment.End},1,0);
+#pragma warning restore 618
label.SetBinding (Label.TextProperty, "Zip");
+#pragma warning disable 618
grid.Children.Add (label = new Label {XAlign = TextAlignment.End},1,1);
+#pragma warning restore 618
label.SetBinding (Label.TextProperty, "City");
View = grid;
grid.Children.Add (new Image {Source = "photo.jpg", Aspect = Aspect.AspectFit});
grid.Children.Add (new Label {
Opacity =.75,
+#pragma warning disable 618
YAlign = TextAlignment.Start,
+#pragma warning restore 618
+
+#pragma warning disable 618
XAlign = TextAlignment.End,
+#pragma warning restore 618
Text ="top and flush right",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Large),
+#pragma warning restore 618
VerticalOptions=LayoutOptions.Start,
HorizontalOptions=LayoutOptions.End,
HeightRequest=30,
});
grid.Children.Add (new Label {
Opacity =.75,
+#pragma warning disable 618
YAlign = TextAlignment.End,
+#pragma warning restore 618
Text ="bottom and flush left",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Large),
+#pragma warning restore 618
VerticalOptions=LayoutOptions.End,
HeightRequest=40,
TextColor = Color.White,
{
public ModuleMediaListItemTemplate()
{
+#pragma warning disable 618
var title = new Label { YAlign = TextAlignment.Center };
+#pragma warning restore 618
title.SetBinding(Label.TextProperty, new Binding("Title", BindingMode.OneWay));
+#pragma warning disable 618
var description = new Label { YAlign = TextAlignment.Center };
+#pragma warning restore 618
description.SetBinding(Label.TextProperty, new Binding("Description", BindingMode.OneWay));
View = new StackLayout
{
public ModuleMediaListHeaderTemplate()
{
+#pragma warning disable 618
var title = new Label { TextColor = Color.White, YAlign = TextAlignment.Center };
+#pragma warning restore 618
title.SetBinding(Label.TextProperty, new Binding("SectionName", BindingMode.OneWay));
View = new StackLayout
{
var title = new Label {
Text = "Select League",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Large),
+#pragma warning restore 618
TextColor = Color.White
};
var seasonLabel = new Label {
Text = "Season",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Small),
+#pragma warning restore 618
TextColor = Color.White
};
var sportLabel = new Label {
Text = "Sport",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Small),
+#pragma warning restore 618
TextColor = Color.White
};
BackgroundColor = Color.Gray,
ItemTemplate = new DataTemplate (() => {
var leagueName = new Label {
- Font =
- Font.SystemFontOfSize (NamedSize.Large),
+#pragma warning disable 618
+ Font = Font.SystemFontOfSize (NamedSize.Large),
+#pragma warning restore 618
BackgroundColor = Color.Transparent,
TextColor = Color.White,
VerticalOptions = LayoutOptions.CenterAndExpand,
new Label () {
Text = title,
VerticalOptions = LayoutOptions.CenterAndExpand,
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Large,
+#pragma warning restore 618
FontAttributes.Bold)
}
}
var name = new Label {
Text = "Foo",
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
Font = Font.SystemFontOfSize(30, FontAttributes.Bold),
+#pragma warning restore 618
TextColor = Color.White,
};
var addressLabel = new Label {
Text = "Loading address…",
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center,
+#pragma warning restore 618
};
var map = new Map {
Label header = new Label
{
Text = "Switch",
+#pragma warning disable 618
Font = Font.BoldSystemFontOfSize(50),
+#pragma warning restore 618
HorizontalOptions = LayoutOptions.Center
};
_label = new Label
{
Text = "Switch is now False",
+#pragma warning disable 618
Font = Font.SystemFontOfSize(NamedSize.Large),
+#pragma warning restore 618
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.CenterAndExpand
};
Text = "I should have red text",
TextColor = Color.Red,
BackgroundColor = new Color (0.5, 0.5, 0.5),
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center
+#pragma warning restore 618
}
};
}
new Person ("Abigail", new DateTime (1975, 1, 15), Color.Aqua),
new Person ("Bob", new DateTime (1976, 2, 20), Color.Black),
new Person ("Cathy", new DateTime (1977, 3, 10), Color.Blue),
+#pragma warning disable 618
new Person ("David", new DateTime (1978, 4, 25), Color.Fuschia),
+#pragma warning restore 618
};
var buttonAdd = new Button {
var label = new Label {
Text = "I should have a toolbar item",
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center
+#pragma warning restore 618
};
var refreshBtn = new ToolbarItem ("Refresh", null, () => label.Text = "Clicking it works");
Title = "Page " + i,
Content = new Label {
Text = "Page " + i,
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center
+#pragma warning restore 618
}
}, random.NextDouble () > 0.5);
}
_label = new Label
{
Text = "Stepper value is 0",
+#pragma warning disable 618
Font = Font.SystemFontOfSize(NamedSize.Large),
+#pragma warning restore 618
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.CenterAndExpand
};
var slFirstName = new StackLayout { Orientation = StackOrientation.Vertical };
var lblFirstNameLabel = new Label {
Text = "First Name",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold),
+#pragma warning restore 618
TextColor = textColor
};
_firstNameEntry = new Entry {
var slMiddleName = new StackLayout { Orientation = StackOrientation.Vertical };
var lblMiddleNameLabel = new Label {
Text = "Middle Name",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold),
+#pragma warning restore 618
TextColor = textColor
};
var entMiddleName = new Entry {
var slLastName = new StackLayout { Orientation = StackOrientation.Vertical };
var lblLastNameLabel = new Label {
Text = "Last Name",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold),
+#pragma warning restore 618
TextColor = textColor
};
var entLastName = new Entry {
var slDob = new StackLayout { Orientation = StackOrientation.Vertical };
var lblDobLabel = new Label {
Text = "Date of Birth",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold),
+#pragma warning restore 618
TextColor = textColor,
+#pragma warning disable 618
XAlign = TextAlignment.Start
+#pragma warning restore 618
};
var entDob = new Entry {
TextColor = dataColor,
var slGender = new StackLayout { Orientation = StackOrientation.Vertical };
var lblGenderLabel = new Label {
Text = "Gender",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold),
+#pragma warning restore 618
TextColor = textColor,
+#pragma warning disable 618
XAlign = TextAlignment.Start
+#pragma warning restore 618
};
slGender.Children.Add (lblGenderLabel);
var slHomePhone = new StackLayout { Orientation = StackOrientation.Vertical };
var lblHomePhoneLabel = new Label {
Text = "Home Phone",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold),
+#pragma warning restore 618
TextColor = textColor,
+#pragma warning disable 618
XAlign = TextAlignment.Start
+#pragma warning restore 618
};
var entHomePhone = new Entry {
TextColor = dataColor,
var slMobilePhone = new StackLayout { Orientation = StackOrientation.Vertical };
var lblMobilePhoneLabel = new Label {
Text = "Mobile Phone",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold),
+#pragma warning restore 618
TextColor = textColor,
+#pragma warning disable 618
XAlign = TextAlignment.Start
+#pragma warning restore 618
};
var entMobilePhone = new Entry {
TextColor = dataColor,
Font dataFont = Font.SystemFontOfSize (NamedSize.Medium);
var nameData = new Label {
TextColor = txtColor,
+#pragma warning disable 618
Font = dataFont,
+#pragma warning restore 618
+
+#pragma warning disable 618
XAlign = TextAlignment.Start,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center,
+#pragma warning restore 618
VerticalOptions = LayoutOptions.Center
};
nameData.SetBinding (Label.TextProperty, "Name");
var genderData = new Label {
TextColor = txtColor,
+#pragma warning disable 618
Font = dataFont,
+#pragma warning restore 618
+
+#pragma warning disable 618
XAlign = TextAlignment.Start,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center,
+#pragma warning restore 618
VerticalOptions = LayoutOptions.Center
};
genderData.SetBinding (Label.TextProperty, "Gender");
var slNameGender = new StackLayout { Orientation = StackOrientation.Horizontal };
+#pragma warning disable 618
var lblGender1 = new Label { Text = " (", Font = dataFont };
+#pragma warning restore 618
+
+#pragma warning disable 618
var lblGender2 = new Label { Text = ")", Font = dataFont };
+#pragma warning restore 618
slNameGender.Children.Add (nameData);
slNameGender.Children.Add (lblGender1);
slNameGender.Children.Add (genderData);
var lblDob = new Label {
TextColor = txtColor,
Text = "DOB: ",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold)
+#pragma warning restore 618
};
var dobData = new Label {
TextColor = txtColor,
+#pragma warning disable 618
Font = dataFont,
+#pragma warning restore 618
+
+#pragma warning disable 618
XAlign = TextAlignment.Start,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center,
+#pragma warning restore 618
VerticalOptions = LayoutOptions.Center
};
dobData.SetBinding (Label.TextProperty, "DateOfBirth");
slDobPhone.Children.Add (lblDob);
slDobPhone.Children.Add (dobData);
+#pragma warning disable 618
var lblSpacer = new Label { Text = " ", Font = dataFont };
+#pragma warning restore 618
slDobPhone.Children.Add (lblSpacer);
var lblPhone = new Label {
TextColor = txtColor,
Text = "PHONE: ",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold)
+#pragma warning restore 618
};
var phoneData = new Label {
TextColor = txtColor,
+#pragma warning disable 618
Font = dataFont,
+#pragma warning restore 618
+
+#pragma warning disable 618
XAlign = TextAlignment.Start,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center,
+#pragma warning restore 618
VerticalOptions = LayoutOptions.Center
};
phoneData.SetBinding (Label.TextProperty, "PrimaryPhone");
[Preserve (AllMembers = true)]
public class ButtonExtensions
{
+#pragma warning disable 618
public static readonly BindableProperty IsPrimaryProperty = BindableProperty.CreateAttached<ButtonExtensions, bool> (
+#pragma warning restore 618
bindable => GetIsPrimary (bindable),
false,
BindingMode.TwoWay,
new Label {
AutomationId = "lblHome",
Text = "Sample Home page",
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center
+#pragma warning restore 618
}
}
};
new Label {
AutomationId = "lblAbout",
Text = "Sample About page",
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center
+#pragma warning restore 618
}
}
};
Padding = new Thickness (0, Device.OnPlatform(20,0,0), 0, 0),
Children = {
new Label {
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
Text = Device.OnPlatform("Custom renderer UITableView","Custom renderer ListView","Custom renderer todo")
},
fasterListView
Padding = new Thickness (5, Device.OnPlatform(20,0,0), 5, 0),
Children = {
new Label {
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
Text = "Xamarin.Forms built-in ListView"
},
listView
Padding = new Thickness (0, Device.OnPlatform(20,0,0), 0, 0),
Children = {
new Label {
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
Text = "Xamarin.Forms native Cell"
},
listView
Padding = new Thickness (0, Device.OnPlatform(20,0,0), 0, 0),
Children = {
new Label {
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
Text = Device.OnPlatform("Custom UITableView+UICell","Custom ListView+Cell","Custom renderer todo")
},
nativeListView2
{
var header = new Label {
Text = "ScrollView",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (50, FontAttributes.Bold),
+#pragma warning restore 618
HorizontalOptions = LayoutOptions.Center
};
"only at runtime, you should probably put it in " +
"a StackLayout just to be sure your stuff doesn't " +
"go running off the bottom of the screen.",
+#pragma warning disable 618
Font = Font.SystemFontOfSize (NamedSize.Large)
+#pragma warning restore 618
}
};
var winPrizeLabel = new Label {
Text = "Win a Xamarin Prize",
+#pragma warning disable 618
XAlign = TextAlignment.Center,
+#pragma warning restore 618
+
+#pragma warning disable 618
YAlign = TextAlignment.Center,
+#pragma warning restore 618
VerticalOptions = LayoutOptions.FillAndExpand
};
+#pragma warning disable 618
Device.OnPlatform (iOS: () => winPrizeLabel.Font = Font.OfSize ("HelveticaNeue-UltraLight", NamedSize.Large));
+#pragma warning restore 618
StackLayout form = MakeForm ();
{
base.Build (stackLayout);
+#pragma warning disable 618
var namedSizeMediumBoldContainer = new ViewContainer<Label> (Test.Label.FontAttibutesBold, new Label { Text = "Medium Bold Font", Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold) });
+#pragma warning restore 618
+
+#pragma warning disable 618
var namedSizeMediumItalicContainer = new ViewContainer<Label> (Test.Label.FontAttributesItalic, new Label { Text = "Medium Italic Font", Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Italic) });
+#pragma warning restore 618
+
+#pragma warning disable 618
var namedSizeLargeContainer = new ViewContainer<Label> (Test.Label.FontNamedSizeLarge, new Label { Text = "Large Font", Font = Font.SystemFontOfSize (NamedSize.Large) });
+#pragma warning restore 618
+
+#pragma warning disable 618
var namedSizeMediumContainer = new ViewContainer<Label> (Test.Label.FontNamedSizeMedium, new Label { Text = "Medium Font", Font = Font.SystemFontOfSize (NamedSize.Medium) });
+#pragma warning restore 618
+
+#pragma warning disable 618
var namedSizeMicroContainer = new ViewContainer<Label> (Test.Label.FontNamedSizeMicro, new Label { Text = "Micro Font", Font = Font.SystemFontOfSize (NamedSize.Micro) });
+#pragma warning restore 618
+
+#pragma warning disable 618
var namedSizeSmallContainer = new ViewContainer<Label> (Test.Label.FontNamedSizeSmall, new Label { Text = "Small Font", Font = Font.SystemFontOfSize (NamedSize.Small) });
+#pragma warning restore 618
var formattedString = new FormattedString ();
formattedString.Spans.Add (new Span { BackgroundColor = Color.Red, ForegroundColor = Color.Olive, Text = "Span 1 " });
Label name = new Label();
name.SetBinding (Label.TextProperty, "FullName");
+#pragma warning disable 618
Label title = new Label { Font = Font.SystemFontOfSize (NamedSize.Micro) };
+#pragma warning restore 618
title.SetBinding (Label.TextProperty, "Title");
return new ViewCell { View = new StackLayout {
};
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;
Label header = new Label
{
Text = "ListView",
+#pragma warning disable 618
Font = Font.BoldSystemFontOfSize(50),
+#pragma warning restore 618
HorizontalOptions = LayoutOptions.Center
};
new Person("Abigail", new DateTime(1975, 1, 15), Color.Aqua),
new Person("Bob", new DateTime(1976, 2, 20), Color.Black),
new Person("Cathy", new DateTime(1977, 3, 10), Color.Blue),
+#pragma warning disable 618
new Person("David", new DateTime(1978, 4, 25), Color.Fuschia),
+#pragma warning restore 618
new Person("Eugenie", new DateTime(1979, 5, 5), Color.Gray),
new Person("Freddie", new DateTime(1980, 6, 30), Color.Green),
new Person("Greta", new DateTime(1981, 7, 15), Color.Lime),
new Person("Pendleton", new DateTime(1978, 4, 10), Color.Yellow),
new Person("Queenie", new DateTime(1979, 5, 15), Color.Aqua),
new Person("Rob", new DateTime(1980, 6, 30), Color.Blue),
+#pragma warning disable 618
new Person("Sally", new DateTime(1981, 7, 5), Color.Fuschia),
+#pragma warning restore 618
new Person("Timothy", new DateTime(1982, 8, 30), Color.Green),
new Person("Uma", new DateTime(1983, 9, 10), Color.Lime),
new Person("Victor", new DateTime(1984, 10, 20), Color.Maroon),
new Person("Abigail", new DateTime(1975, 1, 15), Color.Aqua),
new Person("Bob", new DateTime(1976, 2, 20), Color.Black),
new Person("Cathy", new DateTime(1977, 3, 10), Color.Blue),
+#pragma warning disable 618
new Person("David", new DateTime(1978, 4, 25), Color.Fuschia),
+#pragma warning restore 618
new Person("Eugenie", new DateTime(1979, 5, 5), Color.Gray),
new Person("Freddie", new DateTime(1980, 6, 30), Color.Green),
new Person("Greta", new DateTime(1981, 7, 15), Color.Lime),
new Person("Pendleton", new DateTime(1978, 4, 10), Color.Yellow),
new Person("Queenie", new DateTime(1979, 5, 15), Color.Aqua),
new Person("Rob", new DateTime(1980, 6, 30), Color.Blue),
+#pragma warning disable 618
new Person("Sally", new DateTime(1981, 7, 5), Color.Fuschia),
+#pragma warning restore 618
new Person("Timothy", new DateTime(1982, 8, 30), Color.Green),
new Person("Uma", new DateTime(1983, 9, 10), Color.Lime),
new Person("Victor", new DateTime(1984, 10, 20), Color.Maroon),
new Button {
Text = "Make sure Tint still works",
Command = new Command (() => {
+#pragma warning disable 618
rootNavPage.Tint = Color.Red;
+#pragma warning restore 618
})
},
new Button {
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;0109;4014;1998;0649;0618;0169;0472;0414;0168;0219;0429</NoWarn>
+ <NoWarn>0114;0108;0109;4014;1998;0649;0169;0472;0414;0168;0219;0429</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;0109;4014;1998;0649;0618;0169;0472;0414;0168;0219;0429</NoWarn>
+ <NoWarn>0114;0108;0109;4014;1998;0649;0169;0472;0414;0168;0219;0429</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;0109;4014;1998;0649;0618;0169;0472;0414;0168;0219;0429</NoWarn>
+ <NoWarn>0114;0108;0109;4014;1998;0649;0169;0472;0414;0168;0219;0429</NoWarn>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;4014;1998;0649;0618;0168;0169;0219</NoWarn>
+ <NoWarn>0114;0108;4014;1998;0649;0168;0169;0219</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;4014;1998;0649;0618;0168;0169;0219</NoWarn>
+ <NoWarn>0114;0108;4014;1998;0649;0168;0169;0219</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;4014;1998;0649;0618;0168;0169;0219</NoWarn>
+ <NoWarn>0114;0108;4014;1998;0649;0168;0169;0219</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0114;0108;4014;1998;0649;0169;0168;0219</NoWarn>
+ <NoWarn>0114;0108;4014;1998;0649;0169;0168;0219</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0114;0108;4014;1998;0649;0169;0168;0219</NoWarn>
+ <NoWarn>0114;0108;4014;1998;0649;0169;0168;0219</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.0.5813.39031, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
protected abstract void NavigateToGallery ();
+#pragma warning disable 618
[TestFixtureSetUp]
+#pragma warning restore 618
protected virtual void FixtureSetup ()
{
if (ShouldResetPerFixture) {
}
}
+#pragma warning disable 618
[TestFixtureTearDown]
+#pragma warning restore 618
protected virtual void FixtureTeardown ()
{
}
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;4014;1998;0649;0618;0169;0168;0219</NoWarn>
+ <NoWarn>0114;0108;4014;1998;0649;0169;0168;0219</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;4014;1998;0649;0618;0169;0168;0219</NoWarn>
+ <NoWarn>0114;0108;4014;1998;0649;0169;0168;0219</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;0108;4014;1998;0649;0618;0169;0168;0219</NoWarn>
+ <NoWarn>0114;0108;4014;1998;0649;0169;0168;0219</NoWarn>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
MapRenderer.Bundle = bundle;
+#pragma warning disable 618
if (GooglePlayServicesUtil.IsGooglePlayServicesAvailable(Context) == ConnectionResult.Success)
+#pragma warning restore 618
{
try
{
const string MoveMessageName = "MapMoveToRegion";
+#pragma warning disable 618
protected GoogleMap NativeMap => ((MapView) Control).Map;
+#pragma warning restore 618
protected Map Map => (Map) Element;
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;
}
<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>
<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>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0618;0253</NoWarn>
+ <NoWarn>0253</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
{
Resources.Theme theme = context.Theme;
if (theme != null && theme.ResolveAttribute(id, value, true))
+#pragma warning disable 618
Control.SupportBackgroundTintList = Resources.GetColorStateList(value.Data);
+#pragma warning restore 618
else
Control.SupportBackgroundTintList = new ColorStateList(States, new[] { (int)0xffd7d6d6, 0x7fd7d6d6 });
}
if (value.Type >= DataType.FirstInt && value.Type <= DataType.LastInt)
return value.Data;
if (value.Type == DataType.String)
+#pragma warning disable 618
return context.Resources.GetColor(value.ResourceId);
+#pragma warning restore 618
}
}
catch (Exception ex)
return;
Android.Platform.SetPageContext(page, _context);
+#pragma warning disable 618
IVisualElementRenderer renderView = RendererFactory.GetRenderer(page);
+#pragma warning restore 618
Android.Platform.SetRenderer(page, renderView);
if (layout)
AddView(_backgroundView);
Android.Platform.SetPageContext(modal, context);
+#pragma warning disable 618
_renderer = RendererFactory.GetRenderer(modal);
+#pragma warning restore 618
Android.Platform.SetRenderer(modal, _renderer);
AddView(_renderer.ViewGroup);
SetPadding(padding, padding, padding, padding);
_imageView = new ImageView(context);
+#pragma warning disable 618
var imageParams = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.FillParent)
+#pragma warning restore 618
{
Width = (int)context.ToPixels(60),
Height = (int)context.ToPixels(60),
_mainText.SetSingleLine(true);
_mainText.Ellipsize = TextUtils.TruncateAt.End;
_mainText.SetPadding((int)context.ToPixels(15), padding, padding, padding);
+#pragma warning disable 618
_mainText.SetTextAppearance(context, global::Android.Resource.Attribute.TextAppearanceListItem);
+#pragma warning restore 618
+
+#pragma warning disable 618
using (var lp = new LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent))
+#pragma warning restore 618
textLayout.AddView(_mainText, lp);
_detailText = new TextView(context);
_detailText.Ellipsize = TextUtils.TruncateAt.End;
_detailText.SetPadding((int)context.ToPixels(15), padding, padding, padding);
_detailText.Visibility = ViewStates.Gone;
+#pragma warning disable 618
_detailText.SetTextAppearance(context, global::Android.Resource.Attribute.TextAppearanceListItemSmall);
+#pragma warning restore 618
+
+#pragma warning disable 618
using (var lp = new LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent))
+#pragma warning restore 618
textLayout.AddView(_detailText, lp);
var layoutParams = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent) { Width = 0, Weight = 1, Gravity = GravityFlags.Center };
if (view != null)
{
+#pragma warning disable 618
using (var layout = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.FillParent))
+#pragma warning restore 618
AddView(view, layout);
AccessoryView = view;
SetPadding((int)context.ToPixels(15), padding, padding, padding);
_label = new TextView(context);
+#pragma warning disable 618
_label.SetTextAppearance(context, global::Android.Resource.Attribute.TextAppearanceListItem);
+#pragma warning restore 618
var layoutParams = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent) { Gravity = GravityFlags.CenterVertical };
using (layoutParams)
if (self == Color.Default)
{
using (Resources resources = Resources.System)
+#pragma warning disable 618
return resources.GetColor(defaultColorResourceId);
+#pragma warning restore 618
}
return ToAndroid(self);
}
}
+#pragma warning disable 618
ActionBarDrawerToggle MasterDetailPageToggle { get; set; }
+#pragma warning restore 618
void IDisposable.Dispose()
{
Color colorToUse = Color.Default;
if (CurrentNavigationPage != null)
{
-//#pragma warning disable 618
+#pragma warning disable 618
if (CurrentNavigationPage.Tint != Color.Default)
colorToUse = CurrentNavigationPage.Tint;
-//#pragma warning restore 618
+#pragma warning restore 618
else if (CurrentNavigationPage.BarBackgroundColor != Color.Default)
colorToUse = CurrentNavigationPage.BarBackgroundColor;
}
_renderer.AddView(renderView.ViewGroup);
}
+#pragma warning disable 618
ActionBar.Tab AddTab(Page page, int index)
+#pragma warning restore 618
{
ActionBar actionBar = ((Activity)_context).ActionBar;
TabbedPage currentTabs = CurrentTabbedPage;
+#pragma warning disable 618
ActionBar.Tab atab = actionBar.NewTab();
+#pragma warning restore 618
atab.SetText(page.Title);
atab.TabSelected += (sender, e) =>
{
void CurrentNavigationPageOnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
+#pragma warning disable 618
if (e.PropertyName == NavigationPage.TintProperty.PropertyName)
+#pragma warning restore 618
UpdateActionBarBackgroundColor();
else if (e.PropertyName == NavigationPage.BarBackgroundColorProperty.PropertyName)
UpdateActionBarBackgroundColor();
var drawer = GetRenderer(CurrentMasterDetailPage) as MasterDetailRenderer;
if (drawer == null)
return;
+#pragma warning disable 618
MasterDetailPageToggle = new ActionBarDrawerToggle(_context as Activity, drawer, icon, 0, 0);
+#pragma warning restore 618
MasterDetailPageToggle.SyncState();
}
return;
var page = sender as Page;
+#pragma warning disable 618
ActionBar.Tab atab = actionBar.GetTabAt(currentTabs.Children.IndexOf(page));
+#pragma warning restore 618
atab.SetText(page.Title);
}
}
var i = 0;
foreach (Page tab in CurrentTabbedPage.Children.OfType<Page>())
{
+#pragma warning disable 618
ActionBar.Tab realTab = AddTab(tab, i++);
+#pragma warning restore 618
if (tab == CurrentTabbedPage.CurrentPage)
realTab.Select();
}
return;
if (_defaultDrawable != null)
+#pragma warning disable 618
Control.SetBackgroundDrawable(_defaultDrawable);
+#pragma warning restore 618
_drawableEnabled = false;
}
if (_defaultDrawable == null)
_defaultDrawable = Control.Background;
+#pragma warning disable 618
Control.SetBackgroundDrawable(_backgroundDrawable);
+#pragma warning restore 618
_drawableEnabled = true;
}
base.OnAttachedToWindow();
var adapter = new CarouselPageAdapter(_viewPager, Element, Context);
_viewPager.Adapter = adapter;
+#pragma warning disable 618
_viewPager.SetOnPageChangeListener(adapter);
+#pragma warning restore 618
adapter.UpdateCurrentItem();
if (_viewPager != null)
{
RemoveView(_viewPager);
+#pragma warning disable 618
_viewPager.SetOnPageChangeListener(null);
+#pragma warning restore 618
_viewPager.Dispose();
}
}
if (!span.IsDefault())
+#pragma warning disable 618
spannable.SetSpan(new FontSpan(span.Font, view), start, end, SpanTypes.InclusiveInclusive);
+#pragma warning restore 618
else if (defaultFont != Font.Default)
spannable.SetSpan(new FontSpan(defaultFont, view), start, end, SpanTypes.InclusiveInclusive);
}
void UpdateBackground()
{
+#pragma warning disable 618
SetBackgroundDrawable(new FrameDrawable(Element));
+#pragma warning restore 618
}
class FrameDrawable : Drawable
void UpdateFont()
{
+#pragma warning disable 618
Font f = Element.Font;
+#pragma warning restore 618
Typeface newTypeface = f.ToTypeface();
if (newTypeface != _lastTypeface)
if (Element.FormattedText != null)
{
FormattedString formattedText = Element.FormattedText ?? Element.Text;
+#pragma warning disable 618
_view.TextFormatted = formattedText.ToAttributed(Element.Font, Element.TextColor, _view);
+#pragma warning restore 618
_wasFormatted = true;
}
else
AView bline;
if (makeBline)
{
+#pragma warning disable 618
bline = new AView(_context) { LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, 1) };
+#pragma warning restore 618
layout.AddView(bline);
}
void UpdateBackgroundImage(Page view)
{
if (!string.IsNullOrEmpty(view.BackgroundImage))
+#pragma warning disable 618
SetBackgroundDrawable(Context.Resources.GetDrawable(view.BackgroundImage));
+#pragma warning restore 618
}
void UpdateDetail()
AView bline;
if (makeBline)
{
+#pragma warning disable 618
bline = new AView(Context) { LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, 1) };
+#pragma warning restore 618
layout.AddView(bline);
}
if (Control == null)
{
var webView = new AWebView(Context);
+#pragma warning disable 618
webView.LayoutParameters = new global::Android.Widget.AbsoluteLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent, 0, 0);
+#pragma warning restore 618
webView.SetWebViewClient(new WebClient(this));
_webChromeClient = GetFormsWebChromeClient();
_navigationResult = WebNavigationResult.Failure;
if (errorCode == ClientError.Timeout)
_navigationResult = WebNavigationResult.Timeout;
+#pragma warning disable 618
base.OnReceivedError(view, errorCode, description, failingUrl);
+#pragma warning restore 618
}
public override bool ShouldOverrideUrlLoading(AWebView view, string url)
Log.Warning("Could not load image named: {0}", name);
return null;
}
+#pragma warning disable 618
return resource.GetDrawable(id);
+#pragma warning restore 618
}
public static int GetDrawableByName(string name)
if (s_apiLevel < 16)
{
-//#pragma warning disable 618
+#pragma warning disable 618
view.SetBackgroundDrawable(drawable);
-//#pragma warning restore 618
+#pragma warning restore 618
}
else
view.Background = drawable;
switch (type)
{
case "color":
+#pragma warning disable 618
global::Android.Graphics.Color color = context.Resources.GetColor(background.ResourceId);
+#pragma warning restore 618
view.SetBackgroundColor(color);
break;
case "drawable":
+#pragma warning disable 618
using (Drawable drawable = context.Resources.GetDrawable(background.ResourceId))
+#pragma warning restore 618
+
+#pragma warning disable 618
view.SetBackgroundDrawable(drawable);
+#pragma warning restore 618
break;
}
}
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0642;0618;0114;0108;0672;0168;0169;0184;0649;1998;0414</NoWarn>
+ <NoWarn>0642;0114;0108;0672;0168;0169;0184;0649;1998;0414</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0642;0618;0114;0108;0672;0168;0169;0184;0649;1998;0414</NoWarn>
+ <NoWarn>0642;0114;0108;0672;0168;0169;0184;0649;1998;0414</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0642;0618;0114;0108;0672;0168;0169;0184;0649;1998;0414</NoWarn>
+ <NoWarn>0642;0114;0108;0672;0168;0169;0184;0649;1998;0414</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>1998;0649;0618;0169;0067</NoWarn>
+ <NoWarn>1998;0649;0169;0067</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>1998;0649;0618;0169;0067</NoWarn>
+ <NoWarn>1998;0649;0169;0067</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
- <NoWarn>1998;0649;0618;0169;0067</NoWarn>
+ <NoWarn>1998;0649;0169;0067</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
- <NoWarn>1998;0649;0618;0169;0067</NoWarn>
+ <NoWarn>1998;0649;0169;0067</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
- <NoWarn>1998;0649;0618;0169;0067</NoWarn>
+ <NoWarn>1998;0649;0169;0067</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
- <NoWarn>1998;0649;0618;0169;0067</NoWarn>
+ <NoWarn>1998;0649;0169;0067</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
- <NoWarn>1998;0649;0618;0169;0067</NoWarn>
+ <NoWarn>1998;0649;0169;0067</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
- <NoWarn>1998;0649;0618;0169;0067</NoWarn>
+ <NoWarn>1998;0649;0169;0067</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
run.Foreground = span.ForegroundColor.ToBrush();
if (!span.IsDefault())
+#pragma warning disable 618
run.ApplyFont(span.Font);
-
+#pragma warning restore 618
return run;
}
}
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;
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;
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
};
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);
}
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);
}
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;
<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>
<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>
<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' ">
<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' ">
<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' ">
<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'">
<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>
<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'">
<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>
run.Foreground = span.ForegroundColor.ToBrush();
if (!span.IsDefault())
+#pragma warning disable 618
run.ApplyFont(span.Font);
+#pragma warning restore 618
return run;
}
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;
IVisualElementRenderer renderer = Platform.GetRenderer(self);
if (renderer == null)
{
+#pragma warning disable 618
renderer = RendererFactory.CreateRenderer(self);
+#pragma warning restore 618
Platform.SetRenderer(self, renderer);
}
async void OnEvalRequested(object sender, EventArg<string> 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)
if (span == null)
return null;
+#pragma warning disable 618
var font = span.Font != Font.Default ? span.Font : defaultFont;
+#pragma warning restore 618
var fgcolor = span.ForegroundColor;
if (fgcolor.IsDefault)
void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
{
+#pragma warning disable 618
if (e.PropertyName == NavigationPage.TintProperty.PropertyName)
+#pragma warning restore 618
UpdateTint();
if (e.PropertyName == NavigationPage.BarBackgroundColorProperty.PropertyName)
UpdateBarBackgroundColor();
void UpdateTint()
{
+#pragma warning disable 618
var tintColor = ((NavigationPage)Element).Tint;
+#pragma warning restore 618
if (Forms.IsiOS7OrNewer)
{
<MtouchDebug>true</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0169;0114;0108;0105;0618;0414;0649</NoWarn>
+ <NoWarn>0169;0114;0108;0105;0414;0649</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<CodesignKey>iPhone Developer</CodesignKey>
<DefineConstants>TRACE;__IOS__;__MOBILE__;</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0169;0114;0108;0105;0618;0414;0649</NoWarn>
+ <NoWarn>0169;0114;0108;0105;0414;0649</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0169;0114;0108;0105;0618;0414;0649</NoWarn>
+ <NoWarn>0169;0114;0108;0105;0414;0649</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'AppStore|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0169;0114;0108;0105;0618;0414;0649</NoWarn>
+ <NoWarn>0169;0114;0108;0105;0414;0649</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Xamarin.Forms.Core\Properties\GlobalAssemblyInfo.cs">
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0108;0114;0618;0414;0649</NoWarn>
+ <NoWarn>0108;0114;0414;0649</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0108;0114;0618;0414;0649</NoWarn>
+ <NoWarn>0108;0114;0414;0649</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0108;0114;0618;0414;0649</NoWarn>
+ <NoWarn>0108;0114;0414;0649</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'AppStore|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0108;0114;0618;0414;0649</NoWarn>
+ <NoWarn>0108;0114;0414;0649</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
var label = new Label ().LoadFromXaml (xaml);
Assert.AreEqual (result, label.FontAttributes);
+#pragma warning disable 618
Assert.AreEqual (result, label.Font.FontAttributes);
+#pragma warning restore 618
}
}
}
\ No newline at end of file
}
public static readonly BindableProperty AttachedNullableIntProperty =
+#pragma warning disable 618
BindableProperty.CreateAttached<Bz24910Control, int?> (bindable => GetAttachedNullableInt (bindable), default(int?));
+#pragma warning restore 618
public static int? GetAttachedNullableInt (BindableObject bindable)
{
public class Bz29300DummyView : StackLayout
{
public static readonly BindableProperty NumOfRepeatProperty =
+#pragma warning disable 618
BindableProperty.Create<Bz29300DummyView, int> (p => p.NumOfRepeat, 1, BindingMode.OneWay, null, UpdateTexts);
+#pragma warning restore 618
public static readonly BindableProperty TextProperty =
+#pragma warning disable 618
BindableProperty.Create<Bz29300DummyView, string> (p => p.Text, string.Empty, BindingMode.OneWay, null, UpdateTexts);
+#pragma warning restore 618
public int NumOfRepeat
{
Assert.NotNull (layout.ToolbarItems);
Assert.AreEqual (2, layout.ToolbarItems.Count);
+#pragma warning disable 618
Assert.AreEqual ("One", layout.ToolbarItems [0].Name);
+#pragma warning restore 618
}
}
}
}
public static readonly BindableProperty InnerViewProperty =
+#pragma warning disable 618
BindableProperty.CreateAttached<TestCases, View> (bindable => GetInnerView (bindable), default(View));
+#pragma warning restore 618
public static View GetInnerView (BindableObject bindable)
{
public class Catalog
{
public static readonly BindableProperty MessageProperty =
+#pragma warning disable 618
BindableProperty.CreateAttached<Catalog, string> (bindable => GetMessage (bindable), default(string),
+#pragma warning restore 618
propertyChanged: (bindable, oldvalue, newvalue) => {
var label = bindable as Label;
if (label != null)
public Foo Foo { get; set; }
public static readonly BindableProperty BarProperty =
+#pragma warning disable 618
BindableProperty.Create<Bindable, Bar> (w => w.Bar, default(Bar));
+#pragma warning restore 618
[TypeConverter (typeof(BarConverter))]
public Bar Bar {
public Baz Baz { get; set; }
public static readonly BindableProperty QuxProperty =
+#pragma warning disable 618
BindableProperty.CreateAttached<Bindable, Qux> (bindable => GetQux (bindable), default(Qux));
+#pragma warning restore 618
[TypeConverter (typeof(QuxConverter))]
public static Qux GetQux (BindableObject bindable)
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0672;0618;1998;0219;0414</NoWarn>
+ <NoWarn>0672;1998;0219;0414</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0672;0618;1998;0219;0414</NoWarn>
+ <NoWarn>0672;1998;0219;0414</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<WarningLevel>4</WarningLevel>
<Optimize>false</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0672;0618;1998;0219;0414</NoWarn>
+ <NoWarn>0672;1998;0219;0414</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">