本文整理汇总了C#中System.Security.Policy.Evidence.MarkAllEvidenceAsUsed方法的典型用法代码示例。如果您正苦于以下问题:C# Evidence.MarkAllEvidenceAsUsed方法的具体用法?C# Evidence.MarkAllEvidenceAsUsed怎么用?C# Evidence.MarkAllEvidenceAsUsed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.Policy.Evidence
的用法示例。
在下文中一共展示了Evidence.MarkAllEvidenceAsUsed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckMembershipCondition
internal static bool CheckMembershipCondition(IMembershipCondition membershipCondition, Evidence evidence, out object usedEvidence)
{
IReportMatchMembershipCondition condition = membershipCondition as IReportMatchMembershipCondition;
if (condition != null)
{
return condition.Check(evidence, out usedEvidence);
}
usedEvidence = null;
evidence.MarkAllEvidenceAsUsed();
return membershipCondition.Check(evidence);
}
示例2: CheckMembershipCondition
#pragma warning restore 618
/// <summary>
/// Check the membership condition to see if it matches the given evidence, and if the
/// membership condition supports it also return the evidence which was used to match the
/// membership condition.
/// </summary>
internal static bool CheckMembershipCondition(IMembershipCondition membershipCondition,
Evidence evidence,
out object usedEvidence) {
BCLDebug.Assert(membershipCondition != null, "membershipCondition != null");
BCLDebug.Assert(evidence != null, "evidence != null");
IReportMatchMembershipCondition reportMatchMembershipCondition = membershipCondition as IReportMatchMembershipCondition;
// If the membership condition supports telling us which evidence was used to match, then use
// that capability. Otherwise, we cannot report this information - which means we need to be
// conservative and assume that all of the evidence was used and mark it as such.
if (reportMatchMembershipCondition != null) {
return reportMatchMembershipCondition.Check(evidence, out usedEvidence);
}
else {
usedEvidence = null;
evidence.MarkAllEvidenceAsUsed();
return membershipCondition.Check(evidence);
}
}
示例3: ResolveCodeGroup
#pragma warning disable 618
internal static PolicyStatement ResolveCodeGroup(CodeGroup codeGroup, Evidence evidence)
{
// Custom code groups won't know how to mark the evidence they're using, so we need to
// be pessimistic and mark it all as used if we encounter a code group from outside of mscorlib.
if (codeGroup.GetType().Assembly != typeof(UnionCodeGroup).Assembly)
{
evidence.MarkAllEvidenceAsUsed();
}
return codeGroup.Resolve(evidence);
}
示例4: ResolveCodeGroup
internal static PolicyStatement ResolveCodeGroup(CodeGroup codeGroup, Evidence evidence)
{
if (codeGroup.GetType().Assembly != typeof(UnionCodeGroup).Assembly)
{
evidence.MarkAllEvidenceAsUsed();
}
return codeGroup.Resolve(evidence);
}