当前位置: 首页>>代码示例>>C#>>正文


C# InvocationExpressionSyntax.IsEAPMethod方法代码示例

本文整理汇总了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);
		}
开发者ID:modulexcite,项目名称:CSharpAnalyzer,代码行数:58,代码来源:ConcurrencyUsageWalker.cs

示例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;
        }
开发者ID:modulexcite,项目名称:CSharpAnalyzer,代码行数:37,代码来源:AsyncUsageDetectionWalker.cs

示例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;
        }
开发者ID:modulexcite,项目名称:concurrent-code-analyses,代码行数:14,代码来源:AsyncAwaitDetectionWalker.cs


注:本文中的InvocationExpressionSyntax.IsEAPMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。