本文整理汇总了C#中InvocationExpressionSyntax.IsEAPMethod方法的典型用法代码示例。如果您正苦于以下问题:C# InvocationExpressionSyntax.IsEAPMethod方法的具体用法?C# InvocationExpressionSyntax.IsEAPMethod怎么用?C# InvocationExpressionSyntax.IsEAPMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InvocationExpressionSyntax
的用法示例。
在下文中一共展示了InvocationExpressionSyntax.IsEAPMethod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitInvocationExpression
public override void VisitInvocationExpression(InvocationExpressionSyntax node)
{
var symbol = (IMethodSymbol)SemanticModel.GetSymbolInfo(node).Symbol;
if (symbol != null)
{
IsAsyncLibraryConstruct(symbol.OriginalDefinition);
if (symbol.IsAPMBeginMethod())
{
Logs.TempLog.Info(SourceFile.FilePath + "\n" + node + "\n" + symbol + "\n"+ node.FirstAncestorOrSelf<MethodDeclarationSyntax>() + "******************\n");
Result.APM++;
}
else if (node.IsEAPMethod())
{
Result.EAP++;
}
else if (symbol.IsTAPMethod())
{
// printing TAP methods: Logs.TempLog.Info(SourceFile.FilePath + "\n" + node + "\n" + symbol + "******************\n");
Result.TAP++;
}
else if (symbol.IsThreadStart())
{
Result.ThreadInit++;
}
else if (symbol.IsThreadPoolQueueUserWorkItem())
{
Result.ThreadPoolQueue++;
}
else if (symbol.IsBackgroundWorkerMethod())
{
Result.BackgroundWorker++;
}
else if (symbol.IsAsyncDelegate())
{
Result.AsyncDelegate++;
}
else if (symbol.IsTaskCreationMethod())
{
Result.TaskInit++;
}
else if (symbol.IsParallelFor())
{
Result.ParallelFor++;
}
else if (symbol.IsParallelForEach())
{
Result.ParallelForEach++;
}
else if (symbol.IsParallelInvoke())
{
Result.ParallelInvoke++;
}
}
base.VisitInvocationExpression(node);
}
示例2: DetectAsynchronousUsages
private Enums.AsyncDetected DetectAsynchronousUsages(InvocationExpressionSyntax methodCall, IMethodSymbol methodCallSymbol)
{
var methodCallName = methodCall.Expression.ToString().ToLower();
// DETECT ASYNC CALLS
if (methodCallSymbol.IsThreadStart())
return Enums.AsyncDetected.Thread;
else if (methodCallSymbol.IsThreadPoolQueueUserWorkItem())
return Enums.AsyncDetected.Threadpool;
else if (methodCallSymbol.IsAsyncDelegate())
return Enums.AsyncDetected.AsyncDelegate;
else if (methodCallSymbol.IsBackgroundWorkerMethod())
return Enums.AsyncDetected.BackgroundWorker;
else if (methodCallSymbol.IsTaskCreationMethod())
return Enums.AsyncDetected.Task;
//// DETECT GUI UPDATE CALLS
//else if (methodCallSymbol.IsISynchronizeInvokeMethod())
// return Enums.AsyncDetected.ISynchronizeInvoke;
//else if (methodCallSymbol.IsControlBeginInvoke())
// return Enums.AsyncDetected.ControlInvoke;
//else if (methodCallSymbol.IsDispatcherBeginInvoke())
// return Enums.AsyncDetected.Dispatcher;
// DETECT PATTERNS
else if (methodCallSymbol.IsAPMBeginMethod())
return Enums.AsyncDetected.APM;
else if (methodCall.IsEAPMethod())
return Enums.AsyncDetected.EAP;
else if (methodCallSymbol.IsTAPMethod())
return Enums.AsyncDetected.TAP;
else
return Enums.AsyncDetected.None;
}
示例3: DetectIOAsynchronousUsages
private Enums.AsyncDetected DetectIOAsynchronousUsages(InvocationExpressionSyntax methodCall, IMethodSymbol methodCallSymbol)
{
var methodCallName = methodCall.Expression.ToString().ToLower();
// DETECT PATTERNS
if (methodCallSymbol.IsAPMBeginMethod())
return Enums.AsyncDetected.APM;
else if (methodCall.IsEAPMethod())
return Enums.AsyncDetected.EAP;
else if (methodCallSymbol.IsTAPMethod())
return Enums.AsyncDetected.TAP;
else
return Enums.AsyncDetected.None;
}