本文整理汇总了C#中Composite.C1Console.Security.EntityToken.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# EntityToken.GetHashCode方法的具体用法?C# EntityToken.GetHashCode怎么用?C# EntityToken.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composite.C1Console.Security.EntityToken
的用法示例。
在下文中一共展示了EntityToken.GetHashCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrettyPrintEntityToken
//.........这里部分代码省略.........
IEnumerable<PermissionType> currentPermissionTypes = PermissionTypeFacade.GetCurrentPermissionTypes(new UserToken(username), entityToken, PermissionTypeFacade.GetUserPermissionDefinitions(username), PermissionTypeFacade.GetUserGroupPermissionDefinitions(username));
StringBuilder currentSb = new StringBuilder();
foreach (PermissionType permissionType in currentPermissionTypes)
{
if (currentSb.ToString() != "")
{
currentSb.Append(", ");
}
currentSb.Append(new PermissionDescriptor(permissionType).Label);
}
currentUsersPermisstionTypes.Add(new XElement("span", new XAttribute("style", "padding-left: 15px;"), string.Format("{0} = {1}", username, currentSb.ToString())));
currentUsersPermisstionTypes.Add(new XElement("br"));
}
List<object> userGroupPermissionsDefinedHere = new List<object>();
List<object> inheritedGroupPermissions = new List<object>();
List<IUserGroup> userGroups = DataFacade.GetData<IUserGroup>().ToList();
foreach (IUserGroup userGroup in userGroups)
{
IEnumerable<PermissionType> userGroupPermissionTypes = PermissionTypeFacade.GetLocallyDefinedUserGroupPermissionTypes(userGroup.Id, entityToken);
StringBuilder sb = new StringBuilder();
foreach (PermissionType permissionType in userGroupPermissionTypes)
{
if (sb.ToString() != "")
{
sb.Append(", ");
}
sb.Append(new PermissionDescriptor(permissionType).Label);
}
userGroupPermissionsDefinedHere.Add(new XElement("span", new XAttribute("style", "padding-left: 15px;"), string.Format("{0} = {1}", userGroup.Name, sb.ToString())));
userGroupPermissionsDefinedHere.Add(new XElement("br"));
IEnumerable<PermissionType> inheritedUserGroupPermissionTypes = PermissionTypeFacade.GetInheritedGroupPermissionsTypes(userGroup.Id, entityToken);
sb = new StringBuilder();
foreach (PermissionType permissionType in inheritedUserGroupPermissionTypes)
{
if (sb.ToString() != "")
{
sb.Append(", ");
}
sb.Append(new PermissionDescriptor(permissionType).Label);
}
inheritedGroupPermissions.Add(new XElement("span", new XAttribute("style", "padding-left: 15px;"), string.Format("{0} = {1}", userGroup.Name, sb.ToString())));
inheritedGroupPermissions.Add(new XElement("br"));
}
XElement element =
new XElement("div", new XAttribute("style", string.Format("border:2px; border-style: solid; border-color: {0}; margin-bottom: 2px; margin-left:5px; margin-right:5px; padding: 3px;", color)),
new XElement("b", "Runtime type: "),
entityToken.GetType().ToString(),
new XElement("br"),
new XElement("b", "Hashcode: "),
entityToken.GetHashCode().ToString(),
new XElement("br"),
new XElement("b", "Source: "),
entityToken.Source,
new XElement("br"),
new XElement("b", "Type: "),
entityToken.Type,
new XElement("br"),
new XElement("b", "Id: "),
idList,
new XElement("br"),
new XElement("b", "Serialized entity token: "),
serializedEntityToken,
new XElement("br"),
new XElement("b", "Users permissions defined here: "),
new XElement("br"),
usersermisstionsDefinedHere,
new XElement("br"),
new XElement("b", "Current users permissions here: "),
new XElement("br"),
currentUsersPermisstionTypes,
new XElement("br"),
new XElement("b", "User group permissions defined here: "),
new XElement("br"),
userGroupPermissionsDefinedHere,
new XElement("br"),
new XElement("b", "Inherted user group permissions: "),
new XElement("br"),
inheritedGroupPermissions,
new XElement("br")
);
RelationshipGraphHolder.Controls.Add(new LiteralControl(element.ToString()));
}