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


C# MemberReference.GetCacheName方法代码示例

本文整理汇总了C#中Mono.Cecil.MemberReference.GetCacheName方法的典型用法代码示例。如果您正苦于以下问题:C# MemberReference.GetCacheName方法的具体用法?C# MemberReference.GetCacheName怎么用?C# MemberReference.GetCacheName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Cecil.MemberReference的用法示例。


在下文中一共展示了MemberReference.GetCacheName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddAfferentCoupling

 private void AddAfferentCoupling(MemberReference from, IEnumerable<MemberAccess> to)
 {
     CouplingCacheNode node;
     var toFullName = from.GetCacheName();
     if (!_afferentCache.TryGetValue(toFullName, out node))
     {
         lock (_afferentCache)
         {
             if (!_afferentCache.TryGetValue(toFullName, out node))
             {
                 node = new CouplingCacheNode(toFullName, from);
                 _afferentCache.Add(toFullName, node);
             }
         }
     }
     lock (node)
     {
         foreach (var current in to)
         {
             node.AddCoupling(new Coupling(current.MemberReference.GetCacheName(), current.IsReadOnly, false,
                                           current.IsSelfCall, current.OnField, current.ActualMethodDefinition));
         }
     }
 }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:24,代码来源:CouplingCache.cs

示例2: FillAfferentGraph

        private void FillAfferentGraph(string fullName, Dictionary<string, bool> cutPoints, AffectedGraph graph, MemberReference parent, int depth, TypeDefinition inheritedTypeContext, bool inVirtual, List<string> breadCrumbs, GenericContext genericContext, bool inSelf)
        { 
            WriteWalkerDebug(fullName, depth);
            if (TryBreadCrumbsPrune(fullName, depth, breadCrumbs))
            {
                if (parent != null)
                {
                    WriteWalkerDebug("truncating but adding connection to " + fullName, depth);
                    graph.AddConnection(parent.GetCacheName(), fullName, false);
                }
                return;
            }
            breadCrumbs.Add(fullName);
            if (TryCutPointPrune(fullName, depth, cutPoints))
            {
                if (parent != null)
                {

                    WriteWalkerDebug("bread crumbs truncating but adding connection to " + fullName, depth);
                    graph.AddConnection(parent.GetCacheName(), fullName, false);
                }
                return;
            }
            
            var efferentEntry = _cache.TryGetEfferentCouplingNode(fullName);
            var afferentEntry = _cache.TryGetEfferentCouplingNode(fullName);
            MethodDefinition currentDefinition = null;
            if (efferentEntry != null)
            {
                TypeReference parentType = null;
                if (parent != null) parentType = parent.DeclaringType;
                var definition = efferentEntry.MemberReference.DeclaringType.ThreadSafeResolve();
                if (TryInterfacePrune(fullName, depth, breadCrumbs, efferentEntry, parentType, definition)) return;
                if (TryInheritancePrune(fullName, depth, breadCrumbs, inVirtual, definition, inheritedTypeContext)) {return;}
                inheritedTypeContext = GetNewTypeContext(inheritedTypeContext, definition);
                currentDefinition = efferentEntry.MemberReference as MethodDefinition;
                if (currentDefinition != null)
                {
                    if(currentDefinition.DeclaringType == null) {}
                    if (parent is FieldReference && currentDefinition.IsConstructor)
                    {
                        breadCrumbs.Remove(fullName);
                        return;
                    }
                }
            }
            var touse = afferentEntry ?? efferentEntry;
            WriteWalkerDebug("adding node " + fullName, depth);
            var newnode = GetGraphNode(fullName, touse, parent == null, false);
            graph.AddNode(newnode);
            if (parent != null)
            {
                 graph.AddConnection(parent.GetCacheName(), newnode.FullName, false);    
            }
            if(currentDefinition != null)
                RecurseSynonyms(depth, cutPoints, inheritedTypeContext, currentDefinition, graph, breadCrumbs, genericContext);
            RecurseAfferentCouplings(fullName, depth, cutPoints, inVirtual, inheritedTypeContext, graph, parent, breadCrumbs, genericContext);
            breadCrumbs.Remove(fullName);
        }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:59,代码来源:GraphBuilder.cs


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