本文整理汇总了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));
}
}
}
示例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);
}