本文整理匯總了C#中Mono.Cecil.MethodReference.ThreadSafeResolve方法的典型用法代碼示例。如果您正苦於以下問題:C# MethodReference.ThreadSafeResolve方法的具體用法?C# MethodReference.ThreadSafeResolve怎麽用?C# MethodReference.ThreadSafeResolve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.Cecil.MethodReference
的用法示例。
在下文中一共展示了MethodReference.ThreadSafeResolve方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: IsTeardown
public bool IsTeardown(MethodReference target)
{
var def = target.ThreadSafeResolve();
if (def != null && def.Name == "Finalize" && target.Parameters.Count == 0)
{
return target.DeclaringType.ThreadSafeResolve().GetMethods().Any(IsTest);
}
return false;
}
示例2: IsSetup
public bool IsSetup(MethodReference target)
{
var def = target.ThreadSafeResolve();
if (def != null && def.IsConstructor)
{
return IsXunitFixture(target);
}
return false;
}
示例3: GetHiddenDependenciesForTest
public List<MemberAccess> GetHiddenDependenciesForTest(MethodReference refernece)
{
var m = refernece.ThreadSafeResolve();
var ret = new List<MemberAccess>();
if (!IsTest(refernece)) return ret;
foreach (var method in m.DeclaringType.GetMethodsInHierarchyWithAttribute("ClassInitializeAttribute"))
{
ret.Add(MethodBuildingHelper.BuildMemberAccess(refernece, method));
}
foreach (var method in m.DeclaringType.GetMethodsInHierarchyWithAttribute("ClassCleanupAttribute"))
{
ret.Add(MethodBuildingHelper.BuildMemberAccess(refernece, method));
}
foreach (var method in m.DeclaringType.GetMethodsInHierarchyWithAttribute("TestInitializeAttribute"))
{
ret.Add(MethodBuildingHelper.BuildMemberAccess(refernece, method));
}
foreach (var method in m.DeclaringType.GetMethodsInHierarchyWithAttribute("TestCleanupAttribute"))
{
ret.Add(MethodBuildingHelper.BuildMemberAccess(refernece, method));
}
return ret;
}
示例4: GetSpecificallyMangledName
public string GetSpecificallyMangledName(MethodReference target)
{
if (!IsTest(target)) return null;
var ret = MSpecTranslator.TranslateGeneratedMethod(target.ThreadSafeResolve());
return ret == null ? null : ret.GetCacheName();
}