本文整理汇总了C#中IIdentifier.ToIdentityString方法的典型用法代码示例。如果您正苦于以下问题:C# IIdentifier.ToIdentityString方法的具体用法?C# IIdentifier.ToIdentityString怎么用?C# IIdentifier.ToIdentityString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IIdentifier
的用法示例。
在下文中一共展示了IIdentifier.ToIdentityString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsVisible
public bool IsVisible(ISession session, INakedObject target, IIdentifier member) {
var checkViewType = member.IsField ? CheckType.ViewField : CheckType.Action;
var checkEditType = member.IsField ? CheckType.EditField : CheckType.Action;
var contextView = new AuthorizationContext((ClaimsPrincipal)session.Principal, member.ToIdentityString(IdentifierDepth.ClassName), ((int)checkViewType).ToString());
var contextEdit = new AuthorizationContext((ClaimsPrincipal)session.Principal, member.ToIdentityString(IdentifierDepth.ClassName), ((int)checkEditType).ToString());
// being editable implies visibility
return manager.CheckAccess(contextView) || manager.CheckAccess(contextEdit);
}
示例2: GetText
private string GetText(IIdentifier identifier, string type) {
string form = identifier.IsField ? Property : Action;
string key = identifier.ToIdentityString(IdentifierDepth.ClassNameParams) + ":" + form + "/" + type;
return GetText(key);
}
示例3: GetParameterDescription
private string GetParameterDescription(IIdentifier identifier, int index) {
string key = identifier.ToIdentityString(IdentifierDepth.ClassNameParams) + Action + "/" + Parameter + (index + 1) + "/" + Description;
return GetText(key);
}
示例4: IsUsable
public bool IsUsable(ISession session, INakedObject target, IIdentifier member) {
var checkType = member.IsField ? CheckType.EditField : CheckType.Action;
var context = new AuthorizationContext((ClaimsPrincipal)session.Principal, member.ToIdentityString(IdentifierDepth.ClassName), ((int)checkType).ToString());
return manager.CheckAccess(context);
}
示例5: GetParameterDescription
public string GetParameterDescription(IIdentifier identifier, int index, string original) {
string key = identifier.ToIdentityString(IdentifierDepth.ClassNameParams) + Action + "/" + Parameter + (index + 1) + "/" + Description;
return GetText(key, original);
}