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

◆ FindInterfaces()

virtual Type[] System.Type.FindInterfaces ( TypeFilter filter,
object? filterCriteria )
inlinevirtualinherited

Definition at line 1300 of file Type.cs.

1301 {
1302 if (filter == null)
1303 {
1304 throw new ArgumentNullException("filter");
1305 }
1306 Type[] interfaces = GetInterfaces();
1307 int num = 0;
1308 for (int i = 0; i < interfaces.Length; i++)
1309 {
1310 if (!filter(interfaces[i], filterCriteria))
1311 {
1312 interfaces[i] = null;
1313 }
1314 else
1315 {
1316 num++;
1317 }
1318 }
1319 if (num == interfaces.Length)
1320 {
1321 return interfaces;
1322 }
1323 Type[] array = new Type[num];
1324 num = 0;
1325 foreach (Type type in interfaces)
1326 {
1327 if ((object)type != null)
1328 {
1329 array[num++] = type;
1330 }
1331 }
1332 return array;
1333 }
Type[] GetInterfaces()

References System.array, System.Type.GetInterfaces(), and System.type.

Referenced by System.Diagnostics.Tracing.Statics.FindEnumerableElementType().