修复一处 C29236 (编译时需要绑定 lambda 表达式至少 100 次。请考虑使用显式参数类型声明 lambda 表达式,如果包含的方法调用是泛型的,请考虑使用显式类型参数。)
去除了一处完全无意义的新建 WrapPanel 去除了一处完全无意义的 获取 HotkeyConfiguration Package.props 增加了 NoWarn 去除一下不必关心的 warn
This commit is contained in:
@@ -7,6 +7,11 @@
|
|||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
<PackageProjectUrl>https://github.com/irihitech/Ursa.Avalonia</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/irihitech/Ursa.Avalonia</PackageProjectUrl>
|
||||||
|
|
||||||
|
<NoWarn>
|
||||||
|
IDE0130;IDE00056;IDE0306;IDE0305;IDE0300;IDE0290;IDE0251;IDE0090;IDE0079;IDE0066;IDE0062;IDE0060;IDE0057;IDE0056;IDE0044;IDE0042;IDE0039;IDE0031;IDE0028;IDE0017;
|
||||||
|
CA2208;CA1866;CA1861;CA1859;CA1847;CA1845;CA1822;CA1041;
|
||||||
|
</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||||
|
|||||||
@@ -319,9 +319,19 @@ public class ElasticWrapPanel : WrapPanel
|
|||||||
{
|
{
|
||||||
if (itemSetSize.U > 0)
|
if (itemSetSize.U > 0)
|
||||||
{
|
{
|
||||||
int maxElementCount = lineUVCollection
|
// 用 foreach 替换嵌套 LINQ,彻底避免类型推断和绑定压力
|
||||||
.Max(uiSet => uiSet.UICollection
|
// 修复 C29236 编译时需要绑定 lambda 表达式至少 100 次。请考虑使用显式参数类型声明 lambda 表达式,如果包含的方法调用是泛型的,请考虑使用显式类型参数。
|
||||||
.Sum(p => p.Value.ULengthCount));
|
int maxElementCount = 0;
|
||||||
|
foreach (var uiSet in lineUVCollection)
|
||||||
|
{
|
||||||
|
int sum = 0;
|
||||||
|
foreach (var p in uiSet.UICollection)
|
||||||
|
{
|
||||||
|
sum += p.Value.ULengthCount;
|
||||||
|
}
|
||||||
|
if (sum > maxElementCount)
|
||||||
|
maxElementCount = sum;
|
||||||
|
}
|
||||||
adaptULength = (uvFinalSize.U - maxElementCount * itemSetSize.U) / maxElementCount;
|
adaptULength = (uvFinalSize.U - maxElementCount * itemSetSize.U) / maxElementCount;
|
||||||
adaptULength = Max(adaptULength, 0);
|
adaptULength = Max(adaptULength, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class WrapPanelWithTrailingItem : Panel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WrapPanel p = new WrapPanel();
|
// WrapPanel p = new WrapPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Size MeasureOverride(Size availableSize)
|
protected override Size MeasureOverride(Size availableSize)
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ public class SelectionList : SelectingItemsControl
|
|||||||
|
|
||||||
protected override void OnKeyDown(KeyEventArgs e)
|
protected override void OnKeyDown(KeyEventArgs e)
|
||||||
{
|
{
|
||||||
var hotkeys = Application.Current!.PlatformSettings?.HotkeyConfiguration;
|
// var hotkeys = Application.Current!.PlatformSettings?.HotkeyConfiguration;
|
||||||
|
|
||||||
if (e.Key.ToNavigationDirection() is { } direction && direction.IsDirectional())
|
if (e.Key.ToNavigationDirection() is { } direction && direction.IsDirectional())
|
||||||
e.Handled |= MoveSelection(direction, WrapSelection);
|
e.Handled |= MoveSelection(direction, WrapSelection);
|
||||||
|
|||||||
Reference in New Issue
Block a user