Skip to content

[housekeeping] Automated PR to fix formatting errors #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ bool IsElementVisibleInContainer(FrameworkElement element, FrameworkElement cont

default:
return elementBounds.Left < containerBounds.Right && elementBounds.Right > containerBounds.Left;
};
}
;
}

void OnScrollViewChanged(object sender, ScrollViewerViewChangedEventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,8 @@ public override CGRect Frame
value.Width = (value.X - xSpace) + value.Width;
value.X = xSpace;
}
};
}
;

value.Height = ToolbarHeight;
}
Expand Down
6 changes: 4 additions & 2 deletions src/Controls/src/BindingSourceGen/PathParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ private Result<List<IPathPart>> HandleBinaryExpression(BinaryExpressionSyntax as
if (typeInfo == null)
{
return Result<List<IPathPart>>.Failure(DiagnosticsFactory.UnableToResolvePath(castTo.GetLocation()));
};
}
;

leftResult.Value.Add(new Cast(typeInfo.CreateTypeDescription(_enabledNullable)));

Expand All @@ -161,7 +162,8 @@ private Result<List<IPathPart>> HandleCastExpression(CastExpressionSyntax castEx
if (typeInfo == null)
{
return Result<List<IPathPart>>.Failure(DiagnosticsFactory.UnableToResolvePath(castExpression.GetLocation()));
};
}
;

result.Value.Add(new Cast(typeInfo.CreateTypeDescription(_enabledNullable)));

Expand Down
6 changes: 3 additions & 3 deletions src/Controls/src/Build.Tasks/NodeILExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,9 @@ public static IEnumerable<Instruction> PushServiceProvider(this INode node, ILCo
}
else
yield return Create(Ldnull);

yield return Create(Newobj, module.ImportCtorReference(context.Cache,
type: ("Microsoft.Maui.Controls.Xaml", "Microsoft.Maui.Controls.Xaml.Internals", "SimpleValueTargetProvider"),
type: ("Microsoft.Maui.Controls.Xaml", "Microsoft.Maui.Controls.Xaml.Internals", "SimpleValueTargetProvider"),
parameterTypes: [
("mscorlib", "System", "Object[]"),
("mscorlib", "System", "Object"),
Expand All @@ -677,7 +677,7 @@ public static IEnumerable<Instruction> PushServiceProvider(this INode node, ILCo
yield return Create(Call, module.ImportMethodReference(context.Cache, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
yield return Create(Ldloc, refProvider);
yield return Create(Callvirt, addService);

yield return Create(Dup); //Keep the serviceProvider on the stack
yield return Create(Ldtoken, module.ImportReference(context.Cache, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IRootObjectProvider")));
yield return Create(Call, module.ImportMethodReference(context.Cache, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
Expand Down
4 changes: 2 additions & 2 deletions src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ static IEnumerable<Instruction> SetBinding(VariableDefinition parent, FieldRefer

static bool CanSetValue(FieldReference bpRef, bool attached, INode node, IXmlLineInfo iXmlLineInfo, ILContext context)
{
static bool CanSetValue (TypeReference bpTypeRef, VariableDefinition varValue, ILContext context, IXmlLineInfo iXmlLineInfo)
static bool CanSetValue(TypeReference bpTypeRef, VariableDefinition varValue, ILContext context, IXmlLineInfo iXmlLineInfo)
{
// If it's an attached BP, there's no second chance to handle IMarkupExtensions, so we try here.
// Worst case scenario ? InvalidCastException at runtime
Expand Down Expand Up @@ -1527,7 +1527,7 @@ static IEnumerable<Instruction> SetValue(VariableDefinition parent, FieldReferen
yield return instruction;
if (bpTypeRef.IsValueType)
{
if ( bpTypeRef.ResolveCached(context.Cache).FullName == "System.Nullable`1"
if (bpTypeRef.ResolveCached(context.Cache).FullName == "System.Nullable`1"
&& TypeRefComparer.Default.Equals(varValue.VariableType, ((GenericInstanceType)bpTypeRef).GenericArguments[0]))
bpTypeRef = ((GenericInstanceType)bpTypeRef).GenericArguments[0];
yield return Create(Box, module.ImportReference(bpTypeRef));
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/src/Build.Tasks/XamlCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public FieldReference GetOrAddFieldReference((ModuleDefinition module, string fi
public TypeReference GetOrAddTypeReference(ModuleDefinition module, (string assemblyName, string clrNamespace, string typeName) type) => GetOrAdd(_typeReferenceCache, (module, type.ToString()), x =>
{
if (type.typeName.EndsWith("[]", StringComparison.InvariantCultureIgnoreCase))
return x.module.GetTypeDefinition(this, (type.assemblyName, type.clrNamespace, type.typeName.Substring(0, type.typeName.Length-2))).MakeArrayType();
return x.module.GetTypeDefinition(this, (type.assemblyName, type.clrNamespace, type.typeName.Substring(0, type.typeName.Length - 2))).MakeArrayType();
else
return x.module.ImportReference(x.module.GetTypeDefinition(this, type));
});
Expand Down
3 changes: 2 additions & 1 deletion src/Controls/src/Core/AppThemeBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ void Set()
}
target.SetValueCore(_targetProperty, value, Internals.SetValueFlags.ClearDynamicResource, BindableObject.SetValuePrivateFlags.Default | BindableObject.SetValuePrivateFlags.Converted, specificity);
}
};
}
;
}

object _light;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
UpdateBackground();
else if (e.PropertyName == PlatformConfiguration.iOSSpecific.FlyoutPage.ApplyShadowProperty.PropertyName)
UpdateApplyShadow(((FlyoutPage)Element).OnThisPlatform().GetApplyShadow());
else if (e.PropertyName == Microsoft.Maui.Controls.FlyoutPage.FlyoutLayoutBehaviorProperty.PropertyName)
UpdateFlyoutLayoutBehaviorChanges();
else if (e.PropertyName == Microsoft.Maui.Controls.FlyoutPage.FlyoutLayoutBehaviorProperty.PropertyName)
UpdateFlyoutLayoutBehaviorChanges();
else if (e.PropertyName == PlatformConfiguration.iOSSpecific.Page.PrefersHomeIndicatorAutoHiddenProperty.PropertyName ||
e.PropertyName == PlatformConfiguration.iOSSpecific.Page.PrefersStatusBarHiddenProperty.PropertyName)
UpdatePageSpecifics();
Expand Down Expand Up @@ -481,20 +481,20 @@ void LayoutChildren(bool animated)
void UpdateFlyoutLayoutBehaviorChanges()
{
LayoutChildren(true);
if (FlyoutPage is null)
if (FlyoutPage is null)
return;
FlyoutLayoutBehavior flyoutBehavior = FlyoutPage.FlyoutLayoutBehavior;
bool shouldPresent = FlyoutPageController.ShouldShowSplitMode;
if (flyoutBehavior == FlyoutLayoutBehavior.Popover || flyoutBehavior == FlyoutLayoutBehavior.Default)
{
shouldPresent = false;
}
if (shouldPresent != FlyoutPage.IsPresented)
{
((IElementController)Element).SetValueFromRenderer(FlyoutPage.IsPresentedProperty, shouldPresent);
UpdateLeftBarButton();
}
FlyoutLayoutBehavior flyoutBehavior = FlyoutPage.FlyoutLayoutBehavior;
bool shouldPresent = FlyoutPageController.ShouldShowSplitMode;
if (flyoutBehavior == FlyoutLayoutBehavior.Popover || flyoutBehavior == FlyoutLayoutBehavior.Default)
{
shouldPresent = false;
}

if (shouldPresent != FlyoutPage.IsPresented)
{
((IElementController)Element).SetValueFromRenderer(FlyoutPage.IsPresentedProperty, shouldPresent);
UpdateLeftBarButton();
}
}

void PackContainers()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ public override UITableViewCell GetCell(UITableView tableView, NSIndexPath index
PreserveActivityIndicatorState(cell);
Performance.Stop(reference);

if(platformCell is ContextActionsCell contextActionsCell)
if (platformCell is ContextActionsCell contextActionsCell)
_contextActionsCells.Add(contextActionsCell);

return platformCell;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,8 @@ public override CGRect Frame
value.Width = (value.X - xSpace) + value.Width;
value.X = xSpace;
}
};
}
;

value.Height = ToolbarHeight;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ void UpdateText()
bool selectionExists = _editText.HasSelection;

_editText.Text = _searchHandler.Query ?? string.Empty;

UpdateTextTransform();

// If we had a selection, place the cursor at the end of text
// Otherwise try to maintain the cursor at its previous position
int textLength = _editText.Text?.Length ?? 0;
int newPosition = selectionExists ? textLength : Math.Min(cursorPosition, textLength);

// Prevents the cursor from resetting to position zero when text is set programmatically
_editText.SetSelection(newPosition);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ void RemoveAllButCurrent(Fragment skip)

trans ??= ChildFragmentManager.BeginTransactionEx();
trans.Remove(f);
};
}
;

trans?.CommitAllowingStateLossEx();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ UIImage DrawHamburger()
float size = 3f;
float start = 4f;
context.CGContext.SetLineWidth(size);

for (int i = 0; i < 3; i++)
{
context.CGContext.MoveTo(1f, start + i * (size * 2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ bool IsElementVisibleInContainer(FrameworkElement element, FrameworkElement cont

default:
return elementBounds.Left < containerBounds.Right && elementBounds.Right > containerBounds.Left;
};
}
;
}

async void ScrollToRequested(object sender, ScrollToRequestEventArgs args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.Collections.Generic;
using System.Linq;
using Foundation;
using Microsoft.Maui.Controls.Platform;
using ObjCRuntime;
using UIKit;
using Microsoft.Maui.Controls.Platform;

namespace Microsoft.Maui.Controls.Handlers.Items
{
Expand Down
6 changes: 3 additions & 3 deletions src/Controls/src/Core/Handlers/Items/iOS/TemplatedCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using CoreGraphics;
using Foundation;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using UIKit;
using Microsoft.Maui.Controls.Platform;

namespace Microsoft.Maui.Controls.Handlers.Items
{
Expand Down Expand Up @@ -97,8 +97,8 @@ public override UICollectionViewLayoutAttributes PreferredLayoutAttributesFittin
var preferredAttributes = base.PreferredLayoutAttributesFittingAttributes(layoutAttributes);

if (_measureInvalidated ||
!AttributesConsistentWithConstrainedDimension(preferredAttributes) ||
!preferredAttributes.Frame.Size.IsCloseTo(_size))
!AttributesConsistentWithConstrainedDimension(preferredAttributes) ||
!preferredAttributes.Frame.Size.IsCloseTo(_size))
{
// Measure this cell (including the Forms element) if there is no constrained size
var size = ConstrainedSize == default ? Measure() : ConstrainedSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ private int GetTargetPosition()
{
return 0;
}

return ItemsView.ItemsUpdatingScrollMode switch
{
ItemsUpdatingScrollMode.KeepItemsInView => 0,
Expand Down
3 changes: 2 additions & 1 deletion src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ static NSCollectionLayoutBoundarySupplementaryItem[] CreateSupplementaryItems(La
scrollDirection == UICollectionViewScrollDirection.Vertical
? NSRectAlignment.Top
: NSRectAlignment.Leading));
};
}
;

if (layoutHeaderFooterInfo.HasFooter)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.Collections.Generic;
using System.Linq;
using Foundation;
using Microsoft.Maui.Controls.Platform;
using ObjCRuntime;
using UIKit;
using Microsoft.Maui.Controls.Platform;

namespace Microsoft.Maui.Controls.Handlers.Items2
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void InvalidateLayoutIfItemsMeasureChanged()
// We could then invalidate the layout for supplementary cell only `collectionView.IndexPathForCell(headerCell)` like we do on standard cells,
// but that causes other cells to oddly collapse (see Issue25362 UITest), so in this case we have to stick with `InvalidateLayout`.
var collectionView = CollectionView;

if (ItemsView.Header is not null || ItemsView.HeaderTemplate is not null)
{
var visibleHeaders = collectionView.GetVisibleSupplementaryViews(UICollectionElementKindSectionKey.Header);
Expand Down
3 changes: 2 additions & 1 deletion src/Controls/src/Core/Shell/ShellSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,8 @@ void WaitForRendererToGetRemoved(object s, EventArgs p)
{
sc.Page.PlatformEnabledChanged -= WaitForRendererToGetRemoved;
base.OnChildRemoved(child, oldLogicalIndex);
};
}
;
}
else
{
Expand Down
14 changes: 7 additions & 7 deletions src/Controls/src/Core/VisualElement/VisualElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1416,13 +1416,13 @@ private protected void InvokeMeasureInvalidated(InvalidationTrigger trigger)
}

/// <summary>
/// A flag that determines whether the measure invalidated event should not be propagated up the visual tree.
/// </summary>
/// <remarks>
/// Propagation will still occur within legacy layout subtrees.
/// </remarks>
internal static bool SkipMeasureInvalidatedPropagation { get; set /* for testing purpose */; } =
AppContext.TryGetSwitch("Microsoft.Maui.RuntimeFeature.SkipMeasureInvalidatedPropagation", out var enabled) && enabled;
/// A flag that determines whether the measure invalidated event should not be propagated up the visual tree.
/// </summary>
/// <remarks>
/// Propagation will still occur within legacy layout subtrees.
/// </remarks>
internal static bool SkipMeasureInvalidatedPropagation { get; set /* for testing purpose */; } =
AppContext.TryGetSwitch("Microsoft.Maui.RuntimeFeature.SkipMeasureInvalidatedPropagation", out var enabled) && enabled;

internal virtual void OnChildMeasureInvalidated(VisualElement child, InvalidationTrigger trigger)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/src/Xaml/XamlServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public SimpleValueTargetProvider(object[] objectAndParents, object targetPropert
this.rootObject = rootObject ?? objectAndParents[objectAndParents.Length - 1];
}

public object RootObject => rootObject;
public object RootObject => rootObject;
IEnumerable<object> IProvideParentValues.ParentObjects => objectAndParents;
object IProvideValueTarget.TargetObject => objectAndParents[0];
object IProvideValueTarget.TargetProperty => targetProperty;
Expand Down
3 changes: 2 additions & 1 deletion src/Controls/tests/Core.UnitTests/BindingUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,8 @@ void create()
proxies.Add(new WeakReference(listener));
}
Assert.NotEmpty(proxies); // Should be at least 1
};
}
;
create();

await Task.Yield();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ await AttachAndRun(border, (handler) =>
await AssertColorAtPoint(border, expected, typeof(BorderHandler), cornerRadius, cornerRadius);
}

[Fact]
[Description("The IsVisible property of a Border should match with native IsVisible")]
[Fact]
[Description("The IsVisible property of a Border should match with native IsVisible")]
public async Task VerifyBorderIsVisibleProperty()
{
var border = new Border();
Expand All @@ -73,9 +73,9 @@ public async Task VerifyBorderIsVisibleProperty()
var nativeView = GetNativeBorder(handler);
await InvokeOnMainThreadAsync(() =>
{
var isVisible = nativeView.Visibility == Microsoft.UI.Xaml.Visibility.Visible;
Assert.Equal(expectedValue, isVisible);
});
var isVisible = nativeView.Visibility == Microsoft.UI.Xaml.Visibility.Visible;
Assert.Equal(expectedValue, isVisible);
});
}

ContentPanel GetNativeBorder(BorderHandler borderHandler) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ await InvokeOnMainThreadAsync(() =>

await AssertionExtensions.WaitForGC(handlerReference, platformViewReference);
}

[Fact(DisplayName = "Border With Stroke Shape And Name Does Not Leak")]
public async Task DoesNotLeakWithStrokeShape()
{
Expand Down
Loading