本文整理汇总了C#中IRole.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IRole.GetType方法的具体用法?C# IRole.GetType怎么用?C# IRole.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRole
的用法示例。
在下文中一共展示了IRole.GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: remove_role
public void remove_role(IRole role)
{
roles.RemoveAll(r => r.GetType() == role.GetType());
Contract.Ensures(
roles.Count > 0,
"Personnel must have at least one role"
);
}
示例2: HasRole
public Boolean HasRole(IRole role)
{
foreach (IRole personnel_role in this.roles)
{
if (role.GetType() == personnel_role.GetType()){
return true;
}
}
return false;
}
示例3: C2V
internal static VRole C2V(IRole contract)
{
if (!System.Runtime.Remoting.RemotingServices.IsObjectOutOfAppDomain(contract) &&
(contract.GetType().Equals(typeof(RoleV2C))))
{
return ((RoleV2C)(contract)).GetSourceView();
}
else
{
return new RoleC2V(contract);
}
}
示例4: addOwnerAdminPermission
private static String addOwnerAdminPermission( String securityString, String ownerType, IRole adminRole ) {
String s = adminRole.GetType().FullName + ":" + adminRole.Id + ":1_2_3_4_5_6_7_8_9_10_11_12";
return strUtil.Join( securityString, s, "/" );
}
示例5: Equals
public bool Equals(IRole role)
{
return role.GetType() == typeof(LoaderRole);
}
示例6: AreEqual
protected void AreEqual(IRole fromMP, IRole fromDDI)
{
Assert.AreEqual(fromMP.GetType().FullName, fromDDI.GetType().FullName);
if (fromMP.GetType().ToString() == typeof(Minion).ToString())
{
Minion mp = fromMP as Minion;
Minion ddi = fromDDI as Minion;
Assert.AreEqual(mp.HasRole, ddi.HasRole);
Assert.AreEqual(mp.Type, ddi.Type);
}
else
{
ComplexRole mp = fromMP as ComplexRole;
ComplexRole ddi = fromDDI as ComplexRole;
Assert.AreEqual(mp.Flag, ddi.Flag);
Assert.AreEqual(mp.Leader, ddi.Leader);
Assert.AreEqual(mp.Type, ddi.Type);
}
}