MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / IsAsync

Method IsAsync

src/NodeRTLib/Reflector.cs:596–619  ·  view source on GitHub ↗

We are interseted in methods which return type IAsyncOperation/IAsyncAction

(MethodInfo info)

Source from the content-addressed store, hash-verified

594
595 // We are interseted in methods which return type IAsyncOperation/IAsyncAction
596 public static bool IsAsync(MethodInfo info)
597 {
598 foreach (Type t in info.ReturnType.GetInterfaces())
599 {
600 if (t.FullName == null)
601 continue;
602
603 if (t.FullName.StartsWith("Windows.Foundation.IAsyncOperation`1") ||
604 t.FullName.StartsWith("Windows.Foundation.IAsyncOperationWithProgress`2") ||
605 t.FullName.StartsWith("Windows.Foundation.IAsyncAction") ||
606 t.FullName.StartsWith("Windows.Foundation.IAsyncActionWithProgress`1"))
607 {
608 return true;
609 }
610 }
611
612 if (info.ReturnType.FullName == null)
613 return false;
614
615 return info.ReturnType.FullName.StartsWith("Windows.Foundation.IAsyncOperation`1") ||
616 info.ReturnType.FullName.StartsWith("Windows.Foundation.IAsyncOperationWithProgress`2") ||
617 info.ReturnType.FullName.StartsWith("Windows.Foundation.IAsyncAction") ||
618 info.ReturnType.FullName.StartsWith("Windows.Foundation.IAsyncActionWithProgress`1");
619 }
620
621 public static bool IsArrayAsOut(MethodInfo info, out string sizeStr)
622 {

Callers 1

GenerateModelMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected