本文整理汇总了C#中MemberType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# MemberType.ToString方法的具体用法?C# MemberType.ToString怎么用?C# MemberType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberType
的用法示例。
在下文中一共展示了MemberType.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getMember
internal static StaffMember getMember(HttpSessionStateBase Session ,int memberID,MemberType membertype)
{
Dictionary<String, List<LibraryMemberBase>> librarymembers = Session["LibraryMembers"] as Dictionary<String, List<LibraryMemberBase>>;
List<LibraryMemberBase> staffmemberlist = librarymembers[membertype.ToString()];
StaffMember member = (StaffMember)staffmemberlist.Single(s => s.ID == memberID);
return member;
}
示例2: IsOfMemberType
public static bool IsOfMemberType(this XElement element, MemberType memberType)
{
return element.FirstAttribute?.Value
.StartsWith($"{memberType.ToString().First()}:")
?? false;
}
示例3: GetAuthorizedStates
public IEnumerable<AuthorizationState> GetAuthorizedStates(int memberId, MemberType memberType)
{
//return this.GetAuthorizedStatesCore(memberId, memberType);
//将结果缓存在内存容器中,默认有效期为10分钟
return Zongsoft.Runtime.Caching.MemoryCache.Default.GetValue("Zongsoft.Security.Authorization:" + memberType.ToString() + ":" + memberId.ToString(),
key => new Tuple<object, TimeSpan>(this.GetAuthorizedStatesCore(memberId, memberType), TimeSpan.FromMinutes(10))) as IEnumerable<AuthorizationState>;
}
示例4: MembersOfType
public List<XElement> MembersOfType(XElement element, MemberType memberType)
{
return element.Elements().Where(e => e.FirstAttribute
.Value
.StartsWith($"{memberType.ToString().First()}:"))
.ToList();
}