本文整理汇总了C#中ClaimSet.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ClaimSet.GetType方法的具体用法?C# ClaimSet.GetType怎么用?C# ClaimSet.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClaimSet
的用法示例。
在下文中一共展示了ClaimSet.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowClaimSet
private static void ShowClaimSet(ClaimSet set, bool isIssuer, bool verbose)
{
if (set.HasIssuer())
{
ShowClaimSet(set.Issuer, true, verbose);
}
string setType = set.GetType().Name;
string setName = isIssuer ? "Issuer" : "Issued";
Heading(String.Format("\n{0} Claims ({1})\n", setName, setType),
ConsoleColor.Green);
if (set.Count == 0)
{
Console.WriteLine("(anonymous)\n");
}
foreach (Claim claim in set)
{
if (claim.Right.Equals(Rights.Identity))
{
Console.ForegroundColor = ConsoleColor.White;
}
Console.WriteLine(claim.ClaimType);
if (verbose)
{
Console.WriteLine(claim.Resource.GetType().FullName);
Console.WriteLine(claim.Stringify());
}
else
{
Console.WriteLine(claim.Resource);
}
Console.WriteLine(claim.Right);
Console.WriteLine();
Console.ResetColor();
}
}
示例2: ShowClaimSetHtml
private static void ShowClaimSetHtml(ClaimSet set, bool isIssuer, bool verbose)
{
if (set.HasIssuer())
{
ShowClaimSetHtml(set.Issuer, true, verbose);
}
string setType = set.GetType().Name;
string setName = isIssuer ? "Issuer" : "Issued";
HeadingHtml(String.Format("\n{0} Claims ({1})\n", setName, setType));
foreach (Claim claim in set)
{
bool isIdentity = claim.Right.Equals(Rights.Identity);
WriteLineHtml(claim.ClaimType, isIdentity);
if (verbose)
{
WriteLineHtml(claim.Resource.GetType().FullName, isIdentity);
WriteLineHtml(claim.Stringify(), isIdentity);
}
else
{
WriteLineHtml(claim.Resource.ToString(), isIdentity);
}
WriteLineHtml(claim.Right, isIdentity);
WriteLineHtml("", false);
Console.ResetColor();
}
}