Skip to content

Commit

Permalink
Use Experimental attribute instead of RequiresPreviewFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamescaper committed Nov 14, 2023
1 parent 965fcde commit 9a38d3a
Show file tree
Hide file tree
Showing 159 changed files with 441 additions and 515 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,7 @@ dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_diagnostic.BL0006.severity = none

# CA1724: The type name conflicts in whole or in part with the namespace name. Change either name to eliminate the conflict.
dotnet_diagnostic.CA1724.severity = none
dotnet_diagnostic.CA1724.severity = none

# MBB001: Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
dotnet_diagnostic.MBB001.severity = none
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using System;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using System;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using System.ComponentModel;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.AlohaKit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Microsoft.AspNetCore.Components;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.CommunityToolkit.Behaviors
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.CommunityToolkit.Behaviors
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Microsoft.AspNetCore.Components;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.CommunityToolkit.Behaviors
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.CommunityToolkit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using System.Collections.ObjectModel;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.CommunityToolkit
{
Expand Down Expand Up @@ -55,6 +55,9 @@ static DrawingView()
/// </summary>
[Parameter] public bool? ShouldClearOnFinish { get; set; }
[Parameter] public EventCallback<CM.Core.DrawingLineCompletedEventArgs> OnDrawingLineCompleted { get; set; }
[Parameter] public EventCallback<CM.Core.DrawingLineStartedEventArgs> OnDrawingLineStarted { get; set; }
[Parameter] public EventCallback OnDrawingLineCancelled { get; set; }
[Parameter] public EventCallback<CM.Core.PointDrawnEventArgs> OnPointDrawn { get; set; }

public new CMV.DrawingView NativeControl => (CMV.DrawingView)((BindableObject)this).NativeControl;

Expand Down Expand Up @@ -116,6 +119,36 @@ protected override void HandleParameter(string name, object value)
NativeControl.DrawingLineCompleted += NativeControlDrawingLineCompleted;
}
break;
case nameof(OnDrawingLineStarted):
if (!Equals(OnDrawingLineStarted, value))
{
void NativeControlDrawingLineStarted(object sender, CM.Core.DrawingLineStartedEventArgs e) => InvokeEventCallback(OnDrawingLineStarted, e);

OnDrawingLineStarted = (EventCallback<CM.Core.DrawingLineStartedEventArgs>)value;
NativeControl.DrawingLineStarted -= NativeControlDrawingLineStarted;
NativeControl.DrawingLineStarted += NativeControlDrawingLineStarted;
}
break;
case nameof(OnDrawingLineCancelled):
if (!Equals(OnDrawingLineCancelled, value))
{
void NativeControlDrawingLineCancelled(object sender, EventArgs e) => InvokeEventCallback(OnDrawingLineCancelled);

OnDrawingLineCancelled = (EventCallback)value;
NativeControl.DrawingLineCancelled -= NativeControlDrawingLineCancelled;
NativeControl.DrawingLineCancelled += NativeControlDrawingLineCancelled;
}
break;
case nameof(OnPointDrawn):
if (!Equals(OnPointDrawn, value))
{
void NativeControlPointDrawn(object sender, CM.Core.PointDrawnEventArgs e) => InvokeEventCallback(OnPointDrawn, e);

OnPointDrawn = (EventCallback<CM.Core.PointDrawnEventArgs>)value;
NativeControl.PointDrawn -= NativeControlPointDrawn;
NativeControl.PointDrawn += NativeControlPointDrawn;
}
break;

default:
base.HandleParameter(name, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using MMP = Microsoft.Maui.Primitives;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.CommunityToolkit
{
Expand All @@ -43,10 +43,22 @@ static Popup()
/// </summary>
[Parameter] public MMP.LayoutAlignment? HorizontalOptions { get; set; }
/// <summary>
/// Property that represent Resources of Popup.
/// </summary>
[Parameter] public MC.ResourceDictionary Resources { get; set; }
/// <summary>
/// Gets or sets the <see cref="P:CommunityToolkit.Maui.Views.Popup.Size" /> of the Popup Display.
/// </summary>
[Parameter] public Size? Size { get; set; }
/// <summary>
/// Gets or sets the <see cref="P:CommunityToolkit.Maui.Views.Popup.Style" /> of the Popup.
/// </summary>
[Parameter] public MC.Style Style { get; set; }
/// <summary>
/// Property that represent Style Class of Popup.
/// </summary>
[Parameter] public string StyleClass { get; set; }
/// <summary>
/// Gets or sets the <see cref="T:Microsoft.Maui.Controls.LayoutOptions" /> for positioning the <see cref="T:CommunityToolkit.Maui.Views.Popup" /> vertically on the screen.
/// </summary>
[Parameter] public MMP.LayoutAlignment? VerticalOptions { get; set; }
Expand Down Expand Up @@ -90,13 +102,34 @@ protected override void HandleParameter(string name, object value)
NativeControl.HorizontalOptions = HorizontalOptions ?? (MMP.LayoutAlignment)CMV.Popup.HorizontalOptionsProperty.DefaultValue;
}
break;
case nameof(Resources):
if (!Equals(Resources, value))
{
Resources = (MC.ResourceDictionary)value;
NativeControl.Resources = Resources;
}
break;
case nameof(Size):
if (!Equals(Size, value))
{
Size = (Size?)value;
NativeControl.Size = Size ?? (Size)CMV.Popup.SizeProperty.DefaultValue;
}
break;
case nameof(Style):
if (!Equals(Style, value))
{
Style = (MC.Style)value;
NativeControl.Style = Style;
}
break;
case nameof(StyleClass):
if (!Equals(StyleClass, value))
{
StyleClass = (string)value;
NativeControl.StyleClass = AttributeHelper.GetStringList(StyleClass);
}
break;
case nameof(VerticalOptions):
if (!Equals(VerticalOptions, value))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Microsoft.AspNetCore.Components;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using System;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using System.Collections;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Microsoft.AspNetCore.Components;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using System;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.AspNetCore.Components.Rendering;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Microsoft.Maui.Graphics;
using System.Threading.Tasks;

#pragma warning disable CA2252
#pragma warning disable MBB001

namespace BlazorBindings.Maui.Elements.Material.Components
{
Expand Down
Loading

0 comments on commit 9a38d3a

Please sign in to comment.