Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FindMembers()

virtual MemberInfo[] System.Type.FindMembers ( MemberTypes memberType,
BindingFlags bindingAttr,
MemberFilter? filter,
object? filterCriteria )
inlinevirtualinherited

Definition at line 1336 of file Type.cs.

1337 {
1338 MethodInfo[] array = null;
1339 ConstructorInfo[] array2 = null;
1340 FieldInfo[] array3 = null;
1341 PropertyInfo[] array4 = null;
1342 EventInfo[] array5 = null;
1343 Type[] array6 = null;
1344 int num = 0;
1345 if ((memberType & MemberTypes.Method) != 0)
1346 {
1347 array = GetMethods(bindingAttr);
1348 if (filter != null)
1349 {
1350 for (int i = 0; i < array.Length; i++)
1351 {
1352 if (!filter(array[i], filterCriteria))
1353 {
1354 array[i] = null;
1355 }
1356 else
1357 {
1358 num++;
1359 }
1360 }
1361 }
1362 else
1363 {
1364 num += array.Length;
1365 }
1366 }
1367 if ((memberType & MemberTypes.Constructor) != 0)
1368 {
1369 array2 = GetConstructors(bindingAttr);
1370 if (filter != null)
1371 {
1372 for (int i = 0; i < array2.Length; i++)
1373 {
1374 if (!filter(array2[i], filterCriteria))
1375 {
1376 array2[i] = null;
1377 }
1378 else
1379 {
1380 num++;
1381 }
1382 }
1383 }
1384 else
1385 {
1386 num += array2.Length;
1387 }
1388 }
1389 if ((memberType & MemberTypes.Field) != 0)
1390 {
1391 array3 = GetFields(bindingAttr);
1392 if (filter != null)
1393 {
1394 for (int i = 0; i < array3.Length; i++)
1395 {
1396 if (!filter(array3[i], filterCriteria))
1397 {
1398 array3[i] = null;
1399 }
1400 else
1401 {
1402 num++;
1403 }
1404 }
1405 }
1406 else
1407 {
1408 num += array3.Length;
1409 }
1410 }
1411 if ((memberType & MemberTypes.Property) != 0)
1412 {
1413 array4 = GetProperties(bindingAttr);
1414 if (filter != null)
1415 {
1416 for (int i = 0; i < array4.Length; i++)
1417 {
1418 if (!filter(array4[i], filterCriteria))
1419 {
1420 array4[i] = null;
1421 }
1422 else
1423 {
1424 num++;
1425 }
1426 }
1427 }
1428 else
1429 {
1430 num += array4.Length;
1431 }
1432 }
1433 if ((memberType & MemberTypes.Event) != 0)
1434 {
1435 array5 = GetEvents(bindingAttr);
1436 if (filter != null)
1437 {
1438 for (int i = 0; i < array5.Length; i++)
1439 {
1440 if (!filter(array5[i], filterCriteria))
1441 {
1442 array5[i] = null;
1443 }
1444 else
1445 {
1446 num++;
1447 }
1448 }
1449 }
1450 else
1451 {
1452 num += array5.Length;
1453 }
1454 }
1455 if ((memberType & MemberTypes.NestedType) != 0)
1456 {
1457 array6 = GetNestedTypes(bindingAttr);
1458 if (filter != null)
1459 {
1460 for (int i = 0; i < array6.Length; i++)
1461 {
1462 if (!filter(array6[i], filterCriteria))
1463 {
1464 array6[i] = null;
1465 }
1466 else
1467 {
1468 num++;
1469 }
1470 }
1471 }
1472 else
1473 {
1474 num += array6.Length;
1475 }
1476 }
1477 MemberInfo[] array7 = new MemberInfo[num];
1478 num = 0;
1479 if (array != null)
1480 {
1481 for (int i = 0; i < array.Length; i++)
1482 {
1483 if (array[i] != null)
1484 {
1485 array7[num++] = array[i];
1486 }
1487 }
1488 }
1489 if (array2 != null)
1490 {
1491 foreach (ConstructorInfo constructorInfo in array2)
1492 {
1493 if ((object)constructorInfo != null)
1494 {
1495 array7[num++] = constructorInfo;
1496 }
1497 }
1498 }
1499 if (array3 != null)
1500 {
1501 foreach (FieldInfo fieldInfo in array3)
1502 {
1503 if ((object)fieldInfo != null)
1504 {
1505 array7[num++] = fieldInfo;
1506 }
1507 }
1508 }
1509 if (array4 != null)
1510 {
1511 foreach (PropertyInfo propertyInfo in array4)
1512 {
1513 if ((object)propertyInfo != null)
1514 {
1515 array7[num++] = propertyInfo;
1516 }
1517 }
1518 }
1519 if (array5 != null)
1520 {
1521 foreach (EventInfo eventInfo in array5)
1522 {
1523 if ((object)eventInfo != null)
1524 {
1525 array7[num++] = eventInfo;
1526 }
1527 }
1528 }
1529 if (array6 != null)
1530 {
1531 foreach (Type type in array6)
1532 {
1533 if ((object)type != null)
1534 {
1535 array7[num++] = type;
1536 }
1537 }
1538 }
1539 return array7;
1540 }
FieldInfo[] GetFields()
Definition Type.cs:616
PropertyInfo[] GetProperties()
Definition Type.cs:877
Type[] GetNestedTypes()
Definition Type.cs:806
MethodInfo[] GetMethods()
Definition Type.cs:788
ConstructorInfo[] GetConstructors()
Definition Type.cs:580
virtual EventInfo[] GetEvents()
Definition Type.cs:598

References System.array, System.Type.GetConstructors(), System.Type.GetEvents(), System.Type.GetFields(), System.Type.GetMethods(), System.Type.GetNestedTypes(), System.Type.GetProperties(), and System.type.