浏览代码

minor fixes

/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
c646105b
共有 40 个文件被更改,包括 204 次插入220 次删除
  1. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demos.cs
  2. 5
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ToDoAppSample.cs
  3. 11
      com.unity.uiwidgets/Runtime/cupertino/date_picker.cs
  4. 88
      com.unity.uiwidgets/Runtime/external/SplayTree.cs
  5. 2
      com.unity.uiwidgets/Runtime/external/simplejson/SimpleJSON.cs
  6. 7
      com.unity.uiwidgets/Runtime/foundation/assertions.cs
  7. 2
      com.unity.uiwidgets/Runtime/foundation/collections.cs
  8. 16
      com.unity.uiwidgets/Runtime/foundation/diagnostics.cs
  9. 2
      com.unity.uiwidgets/Runtime/gestures/hit_test.cs
  10. 4
      com.unity.uiwidgets/Runtime/material/bottom_navigation_bar.cs
  11. 4
      com.unity.uiwidgets/Runtime/material/button_bar.cs
  12. 7
      com.unity.uiwidgets/Runtime/material/data_table.cs
  13. 7
      com.unity.uiwidgets/Runtime/material/dropdown.cs
  14. 5
      com.unity.uiwidgets/Runtime/material/navigation_rail.cs
  15. 18
      com.unity.uiwidgets/Runtime/material/paginated_data_table.cs
  16. 4
      com.unity.uiwidgets/Runtime/material/range_slider.cs
  17. 2
      com.unity.uiwidgets/Runtime/material/text_selection.cs
  18. 5
      com.unity.uiwidgets/Runtime/painting/borders.cs
  19. 8
      com.unity.uiwidgets/Runtime/painting/gradient.cs
  20. 9
      com.unity.uiwidgets/Runtime/painting/image_stream.cs
  21. 3
      com.unity.uiwidgets/Runtime/painting/text_span.cs
  22. 4
      com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs
  23. 2
      com.unity.uiwidgets/Runtime/ui2/painting.cs
  24. 4
      com.unity.uiwidgets/Runtime/widgets/DiagnosticableTree.mixin.gen.cs
  25. 3
      com.unity.uiwidgets/Runtime/widgets/DiagnosticableTree.mixin.njk
  26. 20
      com.unity.uiwidgets/Runtime/widgets/DirectionalFocusTraversalPolicy.mixin.gen.cs
  27. 21
      com.unity.uiwidgets/Runtime/widgets/DirectionalFocusTraversalPolicy.mixin.njk
  28. 7
      com.unity.uiwidgets/Runtime/widgets/focus_manager.cs
  29. 12
      com.unity.uiwidgets/Runtime/widgets/focus_traversal.cs
  30. 14
      com.unity.uiwidgets/Runtime/widgets/framework.cs
  31. 3
      com.unity.uiwidgets/Runtime/widgets/gesture_detector.cs
  32. 2
      com.unity.uiwidgets/Runtime/widgets/heroes.cs
  33. 2
      com.unity.uiwidgets/Runtime/widgets/localizations.cs
  34. 16
      com.unity.uiwidgets/Runtime/widgets/navigator.cs
  35. 2
      com.unity.uiwidgets/Runtime/widgets/page_storage.cs
  36. 2
      com.unity.uiwidgets/Runtime/widgets/shortcuts.cs
  37. 2
      com.unity.uiwidgets/Runtime/widgets/sliver.cs
  38. 4
      com.unity.uiwidgets/Runtime/widgets/viewport.cs
  39. 8
      com.unity.uiwidgets/Runtime/widgets/widget_inspector.cs
  40. 85
      com.unity.uiwidgets/Runtime/external/LinqUtils.cs

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demos.cs


foreach (var category in kAllGalleryDemoCategories)
result.Add(category,
ExternalUtils<GalleryDemo>.WhereList(kAllGalleryDemos,((GalleryDemo demo) => { return demo.category == category; })));
LinqUtils<GalleryDemo>.WhereList(kAllGalleryDemos,((GalleryDemo demo) => { return demo.category == category; })));
return result;
}

5
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ToDoAppSample.cs


Widget contents()
{
ExternalUtils<Widget,ToDoItem>.CreateItem createItem = (ToDoItem item) =>
var children = LinqUtils<Widget,ToDoItem>.SelectList(this.items, (ToDoItem item) =>
{
return (Widget) new Text(
item.content, style: new TextStyle(

);
};
var children = ExternalUtils<Widget,ToDoItem>.SelectList(this.items, createItem);
});
return new Flexible(
child: new ListView(
physics: new AlwaysScrollableScrollPhysics(),

11
com.unity.uiwidgets/Runtime/cupertino/date_picker.cs


break;
}
CupertinoThemeData themeData = CupertinoTheme.of(context);
ExternalUtils<Widget>.CreateItem createItem = (Widget child) => {
var result = new Expanded(child: child);
return (Widget) result;
};
return new MediaQuery(
// The native iOS picker's text scaling is fixed, so we will also fix it
// as well in our picker.

child: new DefaultTextStyle(
style: _textStyleFrom(context),
child: new Row(
children:
ExternalUtils<Widget>.SelectList(columns,createItem))
children: LinqUtils<Widget>.SelectList(columns, (Widget child) => {
var result = new Expanded(child: child);
return (Widget) result;
})
)
)
)
)

88
com.unity.uiwidgets/Runtime/external/SplayTree.cs


}
}
}
public class ExternalUtils<T,S>
{
public delegate T CreateItem(S item);
public delegate bool FilterDict(S value);
public static List<T> SelectList(IEnumerable<S> items,CreateItem createItem)
{
if (items == null)
return null;
List<T> results = new List<T>();
foreach (var item in items)
{
results.Add(createItem(item));
}
return results;
}
public static T[] SelectArray(List<S> items,CreateItem createItem)
{
if (items == null)
return null;
T[] results = new T[items.Count()];
foreach (var item in items)
{
int i = items.IndexOf(item);
results[i] = createItem(item);
}
return results;
}
public static Dictionary<T,S> SelectDictionary(IEnumerable<S> items,CreateItem createItem)
{
if (items == null)
return null;
Dictionary<T,S> results = new Dictionary<T,S>();
foreach (var item in items)
{
results.Add(createItem(item),item);
}
return results;
}
public static Dictionary<T,S> WhereDictionary(Dictionary<T,S> items,FilterDict filterDict)
{
if (items == null)
return null;
Dictionary<T,S> results = new Dictionary<T,S>();
foreach (var item in items)
{
if(filterDict(item.Value))
results.Add(item.Key,item.Value);
}
return results;
}
}
public class ExternalUtils<T>
{
public delegate T CreateItem(T item);
public delegate bool FilterItem(T item);
public static List<T> SelectList(IEnumerable<T> items,CreateItem createItem)
{
if (items == null)
return null;
List<T> results = new List<T>();
foreach (var item in items)
{
results.Add(createItem(item));
}
return results;
}
public static List<T> WhereList(IEnumerable<T> items,FilterItem filterItem)
{
if (items == null)
return null;
List<T> results = new List<T>();
foreach (var item in items)
{
if(filterItem(item))
results.Add(item);
}
return results;
}
}
}

2
com.unity.uiwidgets/Runtime/external/simplejson/SimpleJSON.cs


{
try
{
var item = ExternalUtils<string, JSONNode>.WhereDictionary(m_Dict,(k => k.Value == aNode)).First();
var item = LinqUtils<string, JSONNode>.WhereDictionary(m_Dict,(k => k.Value == aNode)).First();
m_Dict.Remove(item.Key);
return aNode;
}

7
com.unity.uiwidgets/Runtime/foundation/assertions.cs


D.assert(() => {
IEnumerable<DiagnosticsNode> summaries =
ExternalUtils<DiagnosticsNode>.WhereList(diagnostics,((DiagnosticsNode node) => node.level == DiagnosticLevel.summary));
LinqUtils<DiagnosticsNode>.WhereList(diagnostics,((DiagnosticsNode node) => node.level == DiagnosticLevel.summary));
if (summaries.Count() > 1) {
return false;
}

ExternalUtils<DiagnosticsNode>.WhereList(diagnostics,((DiagnosticsNode node) => node.level == DiagnosticLevel.summary));
LinqUtils<DiagnosticsNode>.WhereList(diagnostics,((DiagnosticsNode node) => node.level == DiagnosticLevel.summary));
List<DiagnosticsNode> message = new List<DiagnosticsNode>() {
new ErrorSummary("UIWidgetsError contained multiple error summaries."),
new ErrorDescription(

public override string ToString() {
TextTreeRenderer renderer = new TextTreeRenderer(wrapWidth: 400000000);
var values = ExternalUtils<string,DiagnosticsNode>.SelectList(diagnostics,((DiagnosticsNode node) => renderer.render(node).TrimEnd()));
return string.Join("\n",values );
return string.Join("\n", LinqUtils<string,DiagnosticsNode>.SelectList(diagnostics,((DiagnosticsNode node) => renderer.render(node).TrimEnd())));
}
public static void reportError(UIWidgetsErrorDetails details) {

2
com.unity.uiwidgets/Runtime/foundation/collections.cs


if (it == null) {
return null;
}
return "{ " + string.Join(", ", ExternalUtils<string,T>.SelectList(it,(item => item.ToString()))) + " }";
return "{ " + string.Join(", ", LinqUtils<string,T>.SelectList(it,(item => item.ToString()))) + " }";
}
public static void reset<T>(this List<T> list, int size) {

16
com.unity.uiwidgets/Runtime/foundation/diagnostics.cs


builder.writeStretched(config.suffixLineOne, builder.wrapWidth.Value);
}
IEnumerable<DiagnosticsNode> propertiesIterable = ExternalUtils<DiagnosticsNode>.WhereList(node.getProperties(),(
IEnumerable<DiagnosticsNode> propertiesIterable = LinqUtils<DiagnosticsNode>.WhereList(node.getProperties(), (
(DiagnosticsNode n) => !n.isFiltered(_minLevel)
));
List<DiagnosticsNode> properties;

}
if (parentConfiguration != null && !parentConfiguration.lineBreakProperties) {
return string.Join(", ", ExternalUtils<string,T>.SelectList(value,(v => v.ToString())));
return string.Join(", ", LinqUtils<string, T>.SelectList(value, (v => v.ToString())));
return string.Join(style == DiagnosticsTreeStyle.singleLine ? ", " : "\n", ExternalUtils<string,T>.SelectList(value,(v => v.ToString())));
return string.Join(style == DiagnosticsTreeStyle.singleLine ? ", " : "\n",
LinqUtils<string, T>.SelectList(value, (v => v.ToString())));
}
public override DiagnosticLevel level {

public override Dictionary<string, object> toJsonMap(DiagnosticsSerializationDelegate Delegate) {
var json = base.toJsonMap(Delegate);
if (value != null) {
json["values"] = ExternalUtils<string, T>.SelectList(value,(v => v.ToString()));
json["values"] = LinqUtils<string, T>.SelectList(value, (v => v.ToString()));
}
return json;

result.Append(joiner);
DiagnosticPropertiesBuilder builder = new DiagnosticPropertiesBuilder();
debugFillProperties(builder);
var property =
ExternalUtils<DiagnosticsNode>.WhereList(builder.properties, (n => !n.isFiltered(minLevel)));
result.Append(string.Join(joiner,ExternalUtils<string,DiagnosticsNode>.SelectList(property,(n => n.ToString())))
result.Append(string.Join(joiner,LinqUtils<string,DiagnosticsNode>.SelectList(
LinqUtils<DiagnosticsNode>.WhereList(builder.properties, (n => !n.isFiltered(minLevel)))
,(n => n.ToString())))
);
shallowString = result.ToString();
return true;

2
com.unity.uiwidgets/Runtime/gestures/hit_test.cs


public override string ToString() {
return
$"HitTestResult({(_path.isEmpty() ? "<empty path>" : string.Join(", ", ExternalUtils<string,HitTestEntry>.SelectList(_path,(x => x.ToString())) ))})";
$"HitTestResult({(_path.isEmpty() ? "<empty path>" : string.Join(", ", LinqUtils<string,HitTestEntry>.SelectList(_path, (x => x.ToString())) ))})";
}
}
}

4
com.unity.uiwidgets/Runtime/material/bottom_navigation_bar.cs


public float horizontalLeadingOffset {
get {
float weightSum(IEnumerable<Animation<float>> animations) {
return ExternalUtils<float,Animation<float>>.SelectList(animations, state._evaluateFlex).Sum();
return LinqUtils<float,Animation<float>>.SelectList(animations, state._evaluateFlex).Sum();
float allWeights = weightSum(state._animations);
float allWeights = weightSum(state._animations);
float leadingWeights = weightSum(state._animations.GetRange(0, index ?? 0));
return (leadingWeights + state._evaluateFlex(state._animations[index ?? 0]) / 2.0f) /

4
com.unity.uiwidgets/Runtime/material/button_bar.cs


mainAxisAlignment: alignment ?? barTheme?.alignment ?? MainAxisAlignment.end,
mainAxisSize: mainAxisSize ?? barTheme?.mainAxisSize ?? MainAxisSize.max,
overflowDirection: overflowDirection ?? barTheme?.overflowDirection ?? VerticalDirection.down,
children:
ExternalUtils<Widget>.SelectList(children,((Widget childWidget) => {
children: LinqUtils<Widget>.SelectList(children,((Widget childWidget) => {
return (Widget) new Padding(
padding: EdgeInsets.symmetric(horizontal: paddingUnit),
child: childWidget

7
com.unity.uiwidgets/Runtime/material/data_table.cs


List<TableColumnWidth> tableColumns =
new List<TableColumnWidth>(new TableColumnWidth[columns.Count + (displayCheckboxColumn ? 1 : 0)]);
List<TableRow> tableRows =
ExternalUtils<TableRow,int>.SelectList(Enumerable.Range(0, rows.Count + 1),
(index) => {
List<TableRow> tableRows = LinqUtils<TableRow,int>.SelectList(Enumerable.Range(0, rows.Count + 1), (index) => {
return new TableRow(
key: index == 0 ? _headingRowKey : rows[index - 1].key,
decoration: index > 0 && rows[index - 1].selected

displayColumnIndex += 1;
}
var columnWidth = ExternalUtils<int, TableColumnWidth>.SelectDictionary(tableColumns, ((TableColumnWidth x) => tableColumns.IndexOf(x)));
columnWidths: columnWidth,
columnWidths: LinqUtils<int, TableColumnWidth>.SelectDictionary(tableColumns, ((TableColumnWidth x) => tableColumns.IndexOf(x))),
children: tableRows
);
}

7
com.unity.uiwidgets/Runtime/material/dropdown.cs


) :
base(key: key) {
D.assert(items == null || items.isEmpty() || value == null ||
ExternalUtils<DropdownMenuItem<T>>.WhereList(items,((DropdownMenuItem<T> item) => { return item.value.Equals(value); })).Count() == 1,
LinqUtils<DropdownMenuItem<T>>.WhereList(items,((DropdownMenuItem<T> item) => { return item.value.Equals(value); })).Count() == 1,
() => "There should be exactly one item with [DropdownButton]'s value: " +
$"{value}. \n" +
"Either zero or 2 or more [DropdownMenuItem]s were detected " +

}
D.assert(widget.value == null ||
ExternalUtils<DropdownMenuItem<T>>.WhereList(widget.items,((DropdownMenuItem<T> item) => item.value.Equals(widget.value))
LinqUtils<DropdownMenuItem<T>>.WhereList(widget.items,((DropdownMenuItem<T> item) => item.value.Equals(widget.value))
).Count == 1);
_selectedIndex = null;
for (int itemIndex = 0; itemIndex < widget.items.Count; itemIndex++) {

alignment: AlignmentDirectional.centerStart,
children: widget.isDense
? items
: ExternalUtils<Widget>.SelectList(items,(Widget item) => {
: LinqUtils<Widget>.SelectList(items,(Widget item) => {
}
Icon defaultIcon = new Icon(Icons.arrow_drop_down);

5
com.unity.uiwidgets/Runtime/material/navigation_rail.cs


}
void _initControllers() {
_destinationControllers = ExternalUtils<AnimationController, NavigationRailDestination>.SelectList(widget.destinations,
((destination) => {
_destinationControllers = LinqUtils<AnimationController, NavigationRailDestination>.SelectList(widget.destinations, ((destination) => {
var result = new AnimationController(
duration: ThemeUtils.kThemeAnimationDuration,
vsync: this

}));
_destinationAnimations = ExternalUtils<Animation<float>, AnimationController>.SelectList(_destinationControllers,((AnimationController controller) => controller.view));
_destinationAnimations = LinqUtils<Animation<float>, AnimationController>.SelectList(_destinationControllers,((AnimationController controller) => controller.view));
_destinationControllers[widget.selectedIndex ?? 0].setValue(1.0f);
_extendedController = new AnimationController(
duration: ThemeUtils.kThemeAnimationDuration,

18
com.unity.uiwidgets/Runtime/material/paginated_data_table.cs


DataRow _getBlankRowFor(int index) {
return DataRow.byIndex(
index: index,
cells: ExternalUtils<DataCell,DataColumn>.SelectList(widget.columns,((DataColumn column) => DataCell.empty))
cells: LinqUtils<DataCell,DataColumn>.SelectList(widget.columns,((DataColumn column) => DataCell.empty))
List<DataCell> cells = ExternalUtils<DataCell, DataColumn>.SelectList(
widget.columns,((DataColumn column) => {
List<DataCell> cells = LinqUtils<DataCell, DataColumn>.SelectList(widget.columns,((DataColumn column) => {
return DataCell.empty;
}));
if (!haveProgressIndicator) {

}
if (widget.actions != null) {
var headerWidget = ExternalUtils<Widget>.SelectList(widget.actions, ((Widget action) => {
headerWidgets.AddRange(
LinqUtils<Widget>.SelectList(widget.actions, ((Widget action) => {
}));
headerWidgets.AddRange(headerWidget);
}))
);
List<int> availableRowsPerPageInts = ExternalUtils<int>.WhereList(widget.availableRowsPerPage,
((int value) => value <= _rowCount || value == widget.rowsPerPage));
List<Widget> availableRowsPerPage = ExternalUtils<Widget,int>.SelectList(availableRowsPerPageInts,
List<Widget> availableRowsPerPage = LinqUtils<Widget,int>.SelectList(
LinqUtils<int>.WhereList(widget.availableRowsPerPage, ((int value) => value <= _rowCount || value == widget.rowsPerPage)),
(int value) => {
return (Widget) new DropdownMenuItem<int>(
value: value,

4
com.unity.uiwidgets/Runtime/material/range_slider.cs


float _maxSliderPartWidth {
get {
return Mathf.Max(ExternalUtils<float,Size>.SelectList(_sliderPartSizes,((Size size) => size.width)).ToArray());
return Mathf.Max(LinqUtils<float, Size>.SelectArray(_sliderPartSizes,((Size size) => size.width)));
return Mathf.Max(ExternalUtils<float,Size>.SelectList(_sliderPartSizes,((Size size) => size.height)).ToArray());
return Mathf.Max(LinqUtils<float,Size>.SelectArray(_sliderPartSizes,((Size size) => size.height)));
}
}

2
com.unity.uiwidgets/Runtime/material/text_selection.cs


}
public override void debugVisitOnstageChildren(ElementVisitor visitor) {
foreach (var child in ExternalUtils<Element>.WhereList(children,(_shouldPaint))) {
foreach (var child in LinqUtils<Element>.WhereList(children,(_shouldPaint))) {
visitor(child);
}
}

5
com.unity.uiwidgets/Runtime/painting/borders.cs


public override ShapeBorder scale(float t) {
return new _CompoundBorder(
ExternalUtils<ShapeBorder>.SelectList(borders,(border => border.scale(t)))
LinqUtils<ShapeBorder>.SelectList(borders,(border => border.scale(t)))
);
}

public override string ToString() {
return string.Join(" + ",
(
ExternalUtils<string,ShapeBorder>.SelectList(((IList<ShapeBorder>)borders).Reverse(),((border) => border.ToString())))
(LinqUtils<string,ShapeBorder>.SelectList(((IList<ShapeBorder>)borders).Reverse(),((border) => border.ToString())))
);
}
}

8
com.unity.uiwidgets/Runtime/painting/gradient.cs


D.assert(colors.Count >= 2, () => "colors list must have at least two colors");
float separation = 1.0f / (colors.Count - 1);
return ExternalUtils<float, int>.SelectList(Enumerable.Range(0, colors.Count), (i => i * separation));
return LinqUtils<float, int>.SelectList(Enumerable.Range(0, colors.Count), (i => i * separation));
}
public abstract Shader createShader(Rect rect, TextDirection? textDirection = null);

return new LinearGradient(
begin: begin,
end: end,
colors: ExternalUtils<Color>.SelectList(colors,(color => Color.lerp(null, color, factor))),
colors: LinqUtils<Color>.SelectList(colors,(color => Color.lerp(null, color, factor))),
stops: stops,
tileMode: tileMode
);

return new RadialGradient(
center: center,
radius: radius,
colors: ExternalUtils<Color>.SelectList(colors,(color => Color.lerp(null, color, factor))),
colors: LinqUtils<Color>.SelectList(colors,(color => Color.lerp(null, color, factor))),
stops: stops,
tileMode: tileMode
);

center: center,
startAngle: startAngle,
endAngle: endAngle,
colors: ExternalUtils<Color>.SelectList(colors,(color => Color.lerp(null, color, factor))),
colors: LinqUtils<Color>.SelectList(colors,(color => Color.lerp(null, color, factor))),
stops: stops,
tileMode: tileMode
);

9
com.unity.uiwidgets/Runtime/painting/image_stream.cs


return;
}
var localListeners = ExternalUtils<ImageStreamListener>.SelectList(_listeners,(l => l));
var localListeners = LinqUtils<ImageStreamListener>.SelectList(_listeners,(l => l));
foreach (var listener in localListeners) {
try {
listener.onImage(image, false);

informationCollector: informationCollector,
silent: silent
);
var localErrorListeners = ExternalUtils<ImageErrorListener,ImageStreamListener>.SelectList(_listeners, (l => l.onError));
localErrorListeners = ExternalUtils<ImageErrorListener>.WhereList(localErrorListeners,(l => l != null));
var localErrorListeners = LinqUtils<ImageErrorListener>.WhereList(
LinqUtils<ImageErrorListener,ImageStreamListener>.SelectList(_listeners, (l => l.onError)),
(l => l != null));
if (localErrorListeners.isEmpty()) {
UIWidgetsError.reportError(_currentError);

3
com.unity.uiwidgets/Runtime/painting/text_span.cs


if (children == null) {
return new List<DiagnosticsNode>();
}
return ExternalUtils<DiagnosticsNode, InlineSpan>.SelectList(children,(
(child) => {
return LinqUtils<DiagnosticsNode, InlineSpan>.SelectList(children,((child) => {
if (child != null) {
return child.toDiagnosticsNode();
}

4
com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs


trailingGarbage -= 1;
}
ExternalUtils<RenderBox>.WhereList(_keepAliveBucket.Values,(child => {
LinqUtils<RenderBox>.WhereList(_keepAliveBucket.Values, (child => {
D.assert(ExternalUtils<RenderBox>.WhereList(_keepAliveBucket.Values,(child => {
D.assert(LinqUtils<RenderBox>.WhereList(_keepAliveBucket.Values, (child => {
SliverMultiBoxAdaptorParentData childParentData = (SliverMultiBoxAdaptorParentData) child.parentData;
return !childParentData.keepAlive;
})).isEmpty());

2
com.unity.uiwidgets/Runtime/ui2/painting.cs


? PaintingUtils._encodeColorList(colors)
: null;
ushort[] encodedIndices = indices != null
? ExternalUtils<ushort,int>.SelectArray(indices,(i => (ushort) i))
? LinqUtils<ushort, int>.SelectArray(indices, (i => (ushort) i))
: null;
fixed (float* encodedPositionsPtr = encodedPositions, encodedTextureCoordinatesPtr =

4
com.unity.uiwidgets/Runtime/widgets/DiagnosticableTree.mixin.gen.cs


result.Append(joiner);
DiagnosticPropertiesBuilder builder = new DiagnosticPropertiesBuilder();
debugFillProperties(builder);
var property = ExternalUtils<DiagnosticsNode>.WhereList(builder.properties, (n => !n.isFiltered(minLevel)));
ExternalUtils<string,DiagnosticsNode>.SelectList(property,(n => n.ToString()))
)
LinqUtils<string,DiagnosticsNode>.SelectList(LinqUtils<DiagnosticsNode>.WhereList(builder.properties, (n => !n.isFiltered(minLevel))),(n => n.ToString())))
);
shallowString = result.ToString();
return true;

3
com.unity.uiwidgets/Runtime/widgets/DiagnosticableTree.mixin.njk


using System.Collections.Generic;
using System.Linq;
using System.Text;
using Unity.UIWidgets.external;
namespace Unity.UIWidgets.foundation {
{% macro DiagnosticableTreeMixin(with) %}

DiagnosticPropertiesBuilder builder = new DiagnosticPropertiesBuilder();
debugFillProperties(builder);
result.Append(string.Join(joiner,
builder.properties.Where(n => !n.isFiltered(minLevel)).Select(n => n.ToString()).ToArray())
LinqUtils<string,DiagnosticsNode>.SelectList(LinqUtils<DiagnosticsNode>.WhereList(builder.properties, (n => !n.isFiltered(minLevel))),(n => n.ToString())))
);
shallowString = result.ToString();
return true;

20
com.unity.uiwidgets/Runtime/widgets/DirectionalFocusTraversalPolicy.mixin.gen.cs


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.external;
using Unity.UIWidgets.external;
namespace Unity.UIWidgets.widgets {
public class DirectionalFocusTraversalPolicyMixinFocusTraversalPolicy : FocusTraversalPolicy, DirectionalFocusTraversalPolicyMixin {

public override void changedScope(FocusNode node = null, FocusScopeNode oldScope = null) {
base.changedScope(node: node, oldScope: oldScope);
if (oldScope != null) {
var delEntries = ExternalUtils<_DirectionalPolicyDataEntry>.WhereList( _policyData[oldScope]?.history , ((_DirectionalPolicyDataEntry entry)=> {
var delEntries = LinqUtils<_DirectionalPolicyDataEntry>.WhereList( _policyData[oldScope]?.history , ((_DirectionalPolicyDataEntry entry)=> {
return entry.node == node;
}));
foreach (var delEntry in delEntries) {

IEnumerable<FocusNode> result = new List<FocusNode>();
switch (direction) {
case TraversalDirection.left:
result = ExternalUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dx <= target.left));
result = LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dx <= target.left));
result = ExternalUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dx >= target.right));
result = LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dx >= target.right));
break;
case TraversalDirection.up:
case TraversalDirection.down:

FocusTravesalUtils.mergeSort<FocusNode>(sorted, compare: (FocusNode a, FocusNode b) => a.rect.center.dy.CompareTo(b.rect.center.dy));
switch (direction) {
case TraversalDirection.up:
return ExternalUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dy <= target.top));
return LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dy <= target.top));
return ExternalUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dy >= target.bottom));
return LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dy >= target.bottom));
case TraversalDirection.left:
case TraversalDirection.right:
break;

nearestScope.traversalDescendants
);
if (focusedScrollable != null && !focusedScrollable.position.atEdge()) {
IEnumerable<FocusNode> filteredEligibleNodes = ExternalUtils<FocusNode>.WhereList(eligibleNodes,((FocusNode node) => Scrollable.of(node.context) == focusedScrollable));
IEnumerable<FocusNode> filteredEligibleNodes = LinqUtils<FocusNode>.WhereList(eligibleNodes,((FocusNode node) => Scrollable.of(node.context) == focusedScrollable));
if (filteredEligibleNodes.Count() !=0) {
eligibleNodes = filteredEligibleNodes;
}

sorted = sorted.ToList();
}
Rect band = Rect.fromLTRB(focusedChild.rect.left, float.NegativeInfinity, focusedChild.rect.right, float.PositiveInfinity);
IEnumerable<FocusNode> inBand = ExternalUtils<FocusNode>.WhereList(sorted,((FocusNode node) => !node.rect.intersect(band).isEmpty));
IEnumerable<FocusNode> inBand = LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => !node.rect.intersect(band).isEmpty));
if (inBand.Count() !=0) {
found = inBand.First();
break;

case TraversalDirection.left:
eligibleNodes = _sortAndFilterHorizontally(direction, focusedChild.rect, nearestScope);
if (focusedScrollable != null && !focusedScrollable.position.atEdge()) {
IEnumerable<FocusNode> filteredEligibleNodes = ExternalUtils<FocusNode>.WhereList(eligibleNodes,((FocusNode node) => Scrollable.of(node.context) == focusedScrollable));
IEnumerable<FocusNode> filteredEligibleNodes = LinqUtils<FocusNode>.WhereList(eligibleNodes,((FocusNode node) => Scrollable.of(node.context) == focusedScrollable));
if (filteredEligibleNodes.Count()!=0) {
eligibleNodes = filteredEligibleNodes;
}

//sorted = sorted.reversed.toList();
}
band = Rect.fromLTRB(float.NegativeInfinity, focusedChild.rect.top, float.PositiveInfinity, focusedChild.rect.bottom);
inBand = ExternalUtils<FocusNode>.WhereList(sorted,((FocusNode node) => !node.rect.intersect(band).isEmpty));
inBand = LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => !node.rect.intersect(band).isEmpty));
if (inBand.Count()!=0) {
found = inBand.First();
break;

21
com.unity.uiwidgets/Runtime/widgets/DirectionalFocusTraversalPolicy.mixin.njk


using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.external;
namespace Unity.UIWidgets.widgets {
{% macro DirectionalFocusTraversalPolicyMixin(with) %}

public override void changedScope(FocusNode node = null, FocusScopeNode oldScope = null) {
base.changedScope(node: node, oldScope: oldScope);
if (oldScope != null) {
var delEntries = _policyData[oldScope]?.history?.Where((_DirectionalPolicyDataEntry entry)=> {
var delEntries = LinqUtils<_DirectionalPolicyDataEntry>.WhereList( _policyData[oldScope]?.history , ((_DirectionalPolicyDataEntry entry)=> {
});
}));
foreach (var delEntry in delEntries) {
_policyData[oldScope]?.history?.Remove(delEntry);
}

IEnumerable<FocusNode> result = new List<FocusNode>();
switch (direction) {
case TraversalDirection.left:
result = sorted.Where((FocusNode node) => node.rect != target && node.rect.center.dx <= target.left);
result = LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dx <= target.left));
result = sorted.Where((FocusNode node) => node.rect != target && node.rect.center.dx >= target.right);
result = LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dx >= target.right));
break;
case TraversalDirection.up:
case TraversalDirection.down:

FocusTravesalUtils.mergeSort<FocusNode>(sorted, compare: (FocusNode a, FocusNode b) => a.rect.center.dy.CompareTo(b.rect.center.dy));
switch (direction) {
case TraversalDirection.up:
return sorted.Where((FocusNode node) => node.rect != target && node.rect.center.dy <= target.top);
return LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dy <= target.top));
return sorted.Where((FocusNode node) => node.rect != target && node.rect.center.dy >= target.bottom);
return LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => node.rect != target && node.rect.center.dy >= target.bottom));
case TraversalDirection.left:
case TraversalDirection.right:
break;

nearestScope.traversalDescendants
);
if (focusedScrollable != null && !focusedScrollable.position.atEdge()) {
IEnumerable<FocusNode> filteredEligibleNodes = eligibleNodes.Where((FocusNode node) => Scrollable.of(node.context) == focusedScrollable);
IEnumerable<FocusNode> filteredEligibleNodes = LinqUtils<FocusNode>.WhereList(eligibleNodes,((FocusNode node) => Scrollable.of(node.context) == focusedScrollable));
if (filteredEligibleNodes.Count() !=0) {
eligibleNodes = filteredEligibleNodes;
}

sorted = sorted.ToList();
}
Rect band = Rect.fromLTRB(focusedChild.rect.left, float.NegativeInfinity, focusedChild.rect.right, float.PositiveInfinity);
IEnumerable<FocusNode> inBand = sorted.Where((FocusNode node) => !node.rect.intersect(band).isEmpty);
IEnumerable<FocusNode> inBand = LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => !node.rect.intersect(band).isEmpty));
if (inBand.Count() !=0) {
found = inBand.First();
break;

case TraversalDirection.left:
eligibleNodes = _sortAndFilterHorizontally(direction, focusedChild.rect, nearestScope);
if (focusedScrollable != null && !focusedScrollable.position.atEdge()) {
IEnumerable<FocusNode> filteredEligibleNodes = eligibleNodes.Where((FocusNode node) => Scrollable.of(node.context) == focusedScrollable);
IEnumerable<FocusNode> filteredEligibleNodes = LinqUtils<FocusNode>.WhereList(eligibleNodes,((FocusNode node) => Scrollable.of(node.context) == focusedScrollable));
if (filteredEligibleNodes.Count()!=0) {
eligibleNodes = filteredEligibleNodes;
}

//sorted = sorted.reversed.toList();
}
band = Rect.fromLTRB(float.NegativeInfinity, focusedChild.rect.top, float.PositiveInfinity, focusedChild.rect.bottom);
inBand = sorted.Where((FocusNode node) => !node.rect.intersect(band).isEmpty);
inBand = LinqUtils<FocusNode>.WhereList(sorted,((FocusNode node) => !node.rect.intersect(band).isEmpty));
if (inBand.Count()!=0) {
found = inBand.First();
break;

7
com.unity.uiwidgets/Runtime/widgets/focus_manager.cs


public override List<DiagnosticsNode> debugDescribeChildren() {
int count = 1;
return ExternalUtils<DiagnosticsNode, FocusNode>.SelectList(_children, (FocusNode child) => {
return LinqUtils<DiagnosticsNode, FocusNode>.SelectList(_children, (FocusNode child) => {
return child.toDiagnosticsNode(name: $"Child {count++}");
});
}

}
List<string> childList = new List<string>();
_focusedChildren.Reverse();
childList = ExternalUtils<string,FocusNode>.SelectList(_focusedChildren, (FocusNode child) => {
childList = LinqUtils<string,FocusNode>.SelectList(_focusedChildren, (FocusNode child) => {
return child.toStringShort();
});
properties.add(new EnumerableProperty<string>("focusedChildren", childList, defaultValue: new List<string>()));

_dirtyNodes.Add(_primaryFocus);
}
}
ExternalUtils<string,FocusNode>.SelectList(_dirtyNodes,((FocusNode node) => {
LinqUtils<string,FocusNode>.SelectList(_dirtyNodes, ((FocusNode node) => {
return node.toString();
}))
));

12
com.unity.uiwidgets/Runtime/widgets/focus_traversal.cs


return (context.getElementForInheritedWidgetOfExactType<Directionality>().widget as Directionality).textDirection;
}
public static TextDirection commonDirectionalityOf(List<_ReadingOrderSortData> list) {
IEnumerable<HashSet<Directionality>> allAncestors = ExternalUtils<HashSet<Directionality>, _ReadingOrderSortData>.SelectList(list,
((_ReadingOrderSortData member) => new HashSet<Directionality>(member.directionalAncestors)));
IEnumerable<HashSet<Directionality>> allAncestors = LinqUtils<HashSet<Directionality>, _ReadingOrderSortData>.SelectList(list, ((_ReadingOrderSortData member) => new HashSet<Directionality>(member.directionalAncestors)));
HashSet<Directionality> common = null;
foreach ( HashSet<Directionality> ancestorSet in allAncestors) {
common = common ?? ancestorSet;

Rect _rect;
Rect rect {
get {if (_rect == null) {
foreach(Rect rect in ExternalUtils<Rect,_ReadingOrderSortData>.SelectList(members,((_ReadingOrderSortData data) => data.rect))
)
{
foreach(Rect rect in LinqUtils<Rect,_ReadingOrderSortData>.SelectList(members,
(_ReadingOrderSortData data) => data.rect)){
_rect = _rect ?? rect;
_rect = _rect.expandToInclude(rect);
}

List<_ReadingOrderSortData> inBand(_ReadingOrderSortData current, IEnumerable<_ReadingOrderSortData> _candidates) {
Rect band = Rect.fromLTRB(float.NegativeInfinity, current.rect.top, float.PositiveInfinity, current.rect.bottom);
return ExternalUtils<_ReadingOrderSortData>.WhereList(_candidates,((_ReadingOrderSortData item)=> {
return LinqUtils<_ReadingOrderSortData>.WhereList(_candidates,((_ReadingOrderSortData item)=> {
return !item.rect.intersect(band).isEmpty;
}));
}

);
return a.order.CompareTo(b.order);
});
return ExternalUtils<FocusNode,_OrderedFocusInfo>.SelectList(ordered,((_OrderedFocusInfo info) => info.node)).Concat(unordered);
return LinqUtils<FocusNode,_OrderedFocusInfo>.SelectList(ordered,((_OrderedFocusInfo info) => info.node)).Concat(unordered);
}
}

14
com.unity.uiwidgets/Runtime/widgets/framework.cs


if (keys.isNotEmpty()) {
var keyStringCount = new Dictionary<string, int>();
foreach (string key in ExternalUtils<string,GlobalKey>.SelectList(keys,(key => key.ToString()))) {
foreach (string key in LinqUtils<string, GlobalKey>.SelectList(keys,(key => key.ToString()))) {
if (keyStringCount.ContainsKey(key)) {
keyStringCount[key] += 1;
}

var elements = _debugElementsThatWillNeedToBeRebuiltDueToGlobalKeyShenanigans.Keys;
var elementStringCount = new Dictionary<string, int>();
foreach (string element in ExternalUtils<string,Element>.SelectList(elements,(element => element.ToString()))) {
foreach (string element in LinqUtils<string, Element>.SelectList(elements,(element => element.ToString()))) {
if (elementStringCount.ContainsKey(element)) {
elementStringCount[element] += 1;
}

public static DiagnosticsNode describeElements(string name, IEnumerable<Element> elements) {
return new DiagnosticsBlock(
name: name,
children: ExternalUtils<DiagnosticsNode,Element>.SelectList(elements,((Element element) => new DiagnosticsProperty<Element>("", element))),
children: LinqUtils<DiagnosticsNode, Element>.SelectList(elements,((Element element) => new DiagnosticsProperty<Element>("", element))),
allowTruncate: true
);
}

properties.add(new FlagProperty("dirty", value: dirty, ifTrue: "dirty"));
if (_dependencies != null && _dependencies.isNotEmpty()) {
List<DiagnosticsNode> diagnosticsDependencies = ExternalUtils<DiagnosticsNode,InheritedElement>.SelectList(_dependencies,
((InheritedElement element) =>
List<DiagnosticsNode> diagnosticsDependencies = LinqUtils<DiagnosticsNode, InheritedElement>
.SelectList(_dependencies, ((InheritedElement element) =>
element.widget.toDiagnosticsNode(style: DiagnosticsTreeStyle.sparse)));
properties.add(new DiagnosticsProperty<List<DiagnosticsNode>>("dependencies", diagnosticsDependencies));
}

}
protected IEnumerable<Element> children {
get {
return ExternalUtils<Element>.WhereList(_children,((child) => !_forgottenChildren.Contains(child)));
}
get { return LinqUtils<Element>.WhereList(_children,((child) => !_forgottenChildren.Contains(child))); }
}
List<Element> _children;

3
com.unity.uiwidgets/Runtime/widgets/gesture_detector.cs


properties.add(DiagnosticsNode.message("DISPOSED"));
}
else {
List<string> gestures = ExternalUtils<string, GestureRecognizer>.SelectList(_recognizers.Values,
(recognizer => recognizer.debugDescription));
List<string> gestures = LinqUtils<string, GestureRecognizer>.SelectList(_recognizers.Values, (recognizer => recognizer.debugDescription));
properties.add(new EnumerableProperty<string>("gestures", gestures, ifEmpty: "<none>"));
properties.add(new EnumerableProperty<GestureRecognizer>("recognizers", _recognizers.Values,
level: DiagnosticLevel.fine));

2
com.unity.uiwidgets/Runtime/widgets/heroes.cs


&& flight._proxyAnimation.isDismissed;
}
List<_HeroFlight> invalidFlights = ExternalUtils<_HeroFlight>.WhereList(_flights.Values,isInvalidFlight);
List<_HeroFlight> invalidFlights = LinqUtils<_HeroFlight>.WhereList(_flights.Values, isInvalidFlight);
foreach ( _HeroFlight flight in invalidFlights) {
flight._handleAnimationUpdate(AnimationStatus.dismissed);
}

2
com.unity.uiwidgets/Runtime/widgets/localizations.cs


if (pendingList == null) {
return Future.value(output).to<Dictionary<Type, object>>();
}
return Future.wait<object>(ExternalUtils<Future<object>,_Pending>.SelectList( pendingList,(p => p.futureValue)))
return Future.wait<object>(LinqUtils<Future<object>, _Pending>.SelectList(pendingList, (p => p.futureValue)))
.then(values => {
var list = (List<object>)values;

16
com.unity.uiwidgets/Runtime/widgets/navigator.cs


}
if (initialRoute != null) {
var routes =
widget.onGenerateInitialRoutes(
_history.AddRange(
LinqUtils<_RouteEntry,Route>.SelectList(
widget.onGenerateInitialRoutes(
widget.initialRoute ?? Navigator.defaultRouteName
widget.initialRoute ?? Navigator.defaultRouteName
), (Route route) =>
new _RouteEntry(
route,
initialState: _RouteLifecycle.add
)
)
_history.AddRange(ExternalUtils<_RouteEntry,Route>.SelectList(routes, ((Route route) =>
new _RouteEntry(route, initialState: _RouteLifecycle.add))));
}
D.assert(!_debugLocked);
D.assert(() => {

2
com.unity.uiwidgets/Runtime/widgets/page_storage.cs


}
public override string ToString() {
return $"StorageEntryIdentifier({string.Join(":", ExternalUtils<string,PageStorageKey>.SelectList(keys,(x => x.ToString())))})";
return $"StorageEntryIdentifier({string.Join(":", LinqUtils<string, PageStorageKey>.SelectList(keys, (x => x.ToString())))})";
}
public bool Equals(_StorageEntryIdentifier other) {

2
com.unity.uiwidgets/Runtime/widgets/shortcuts.cs


return a.debugName.CompareTo(strB: b.debugName);
}
);
var results = ExternalUtils<string, LogicalKeyboardKey>.SelectList(sortedKeys, (key => key.debugName));
var results = LinqUtils<string, LogicalKeyboardKey>.SelectList(sortedKeys, (key => key.debugName));
return string.Join(" + ", values: results);
}

2
com.unity.uiwidgets/Runtime/widgets/sliver.cs


}
public override void debugVisitOnstageChildren(ElementVisitor visitor) {
ExternalUtils<Element>.WhereList(_childElements.Values,(child => {
LinqUtils<Element>.WhereList(_childElements.Values, (child => {
SliverMultiBoxAdaptorParentData parentData =
(SliverMultiBoxAdaptorParentData) child.renderObject.parentData;
float itemExtent = 0;

4
com.unity.uiwidgets/Runtime/widgets/viewport.cs


) : base(key: key, children: slivers) {
D.assert(offset != null);
D.assert(slivers != null);
D.assert(center == null || ExternalUtils<Widget>.WhereList(slivers,((Widget child) => child.key == center)).Count() == 1);
D.assert(center == null || LinqUtils<Widget>.WhereList(slivers,((Widget child) => child.key == center)).Count() == 1);
D.assert(cacheExtentStyle != null);
D.assert(cacheExtentStyle != CacheExtentStyle.viewport || cacheExtent != null);
this.axisDirection = axisDirection;

}
public override void debugVisitOnstageChildren(ElementVisitor visitor) {
ExternalUtils<Element>.WhereList(children,(e => {
LinqUtils<Element>.WhereList(children, (e => {
RenderSliver renderSliver = (RenderSliver) e.renderObject;
return renderSliver.geometry.visible;
})).ForEach(e => visitor(e));

8
com.unity.uiwidgets/Runtime/widgets/widget_inspector.cs


path = _getElementParentChain((Element)value, groupName);
else
throw new UIWidgetsError(new List<DiagnosticsNode>{new ErrorSummary($"Cannot get parent chain for node of type {value.GetType()}")});
return ExternalUtils<Dictionary<string, object>, _DiagnosticsPathNode>.SelectList(
return LinqUtils<Dictionary<string, object>, _DiagnosticsPathNode>.SelectList(
path,((_DiagnosticsPathNode node) =>
_pathNodeToJson(node, new InspectorSerializationDelegate(groupName: groupName, service: this))
));

}
}
if (isElement && isWidgetCreationTracked()) {
List<DiagnosticsNode> localNodes = ExternalUtils<DiagnosticsNode>.WhereList(nodes,(DiagnosticsNode node) =>
List<DiagnosticsNode> localNodes = LinqUtils<DiagnosticsNode>.WhereList(nodes,(DiagnosticsNode node) =>
_isValueCreatedByLocalProject(node.value));
if (localNodes.isNotEmpty()) {
return localNodes;

}
public override List<DiagnosticsNode> filterProperties(List<DiagnosticsNode> properties, DiagnosticsNode owner) {
bool createdByLocalProject = _nodesCreatedByLocalProject.Contains(owner);
return ExternalUtils<DiagnosticsNode>.WhereList(properties,(DiagnosticsNode node)=>{
return LinqUtils<DiagnosticsNode>.WhereList(properties,(DiagnosticsNode node)=>{
return !node.isFiltered(createdByLocalProject ? DiagnosticLevel.fine : DiagnosticLevel.info);
});
}

if (parameterLocations != null) {
json["parameterLocations"] =
ExternalUtils<object, _Location>.SelectList(
LinqUtils<object, _Location>.SelectList(
parameterLocations,((_Location location) => location.toJsonMap()));
}

85
com.unity.uiwidgets/Runtime/external/LinqUtils.cs


using System.Collections.Generic;
namespace Unity.UIWidgets.external
{
public static class LinqUtils<T, S>
{
public delegate T CreateItem(S item);
public delegate bool FilterDict(S value);
public static List<T> SelectList(IEnumerable<S> items, CreateItem createItem)
{
if (items == null)
return null;
var results = new List<T>();
foreach (var item in items) results.Add(createItem(item));
return results;
}
public static T[] SelectArray(List<S> items, CreateItem createItem)
{
if (items == null)
return null;
var itemCount = items.Count;
var results = new T[itemCount];
for (var i= 0; i < itemCount; i++)
{
results[i] = createItem(items[i]);
}
return results;
}
public static Dictionary<T, S> SelectDictionary(IEnumerable<S> items, CreateItem createItem)
{
if (items == null)
return null;
var results = new Dictionary<T, S>();
foreach (var item in items) results.Add(createItem(item), item);
return results;
}
public static Dictionary<T, S> WhereDictionary(Dictionary<T, S> items, FilterDict filterDict)
{
if (items == null)
return null;
var results = new Dictionary<T, S>();
foreach (var item in items)
if (filterDict(item.Value))
results.Add(item.Key, item.Value);
return results;
}
}
public static class LinqUtils<T>
{
public delegate T CreateItem(T item);
public delegate bool FilterItem(T item);
public static List<T> SelectList(IEnumerable<T> items, CreateItem createItem)
{
if (items == null)
return null;
var results = new List<T>();
foreach (var item in items) results.Add(createItem(item));
return results;
}
public static List<T> WhereList(IEnumerable<T> items, FilterItem filterItem)
{
if (items == null)
return null;
var results = new List<T>();
foreach (var item in items)
if (filterItem(item))
results.Add(item);
return results;
}
}
}
正在加载...
取消
保存