本文整理匯總了C#中umbraco.cms.businesslogic.member.Member.RemoveGroup方法的典型用法代碼示例。如果您正苦於以下問題:C# Member.RemoveGroup方法的具體用法?C# Member.RemoveGroup怎麽用?C# Member.RemoveGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類umbraco.cms.businesslogic.member.Member
的用法示例。
在下文中一共展示了Member.RemoveGroup方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: rptMember_ItemCommand
protected void rptMember_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "delete")
{
Member memberToDelete = new Member(id);
foreach (MemberGroup memberGroup in memberToDelete.Groups)
{
memberToDelete.RemoveGroup(memberGroup.Id);
}
memberToDelete.delete();
this.lblResultInfo.Text = "Lid verwijderd uit alle groepen!";
}
}
}
示例2: RemoveMemberFromPotentialSpamGroup
public static void RemoveMemberFromPotentialSpamGroup(Member member)
{
var memberGroup = MemberGroup.GetByName(SpamMemberGroupName);
if (memberGroup == null)
MemberGroup.MakeNew(SpamMemberGroupName, new User(0));
memberGroup = MemberGroup.GetByName(SpamMemberGroupName);
if (Roles.IsUserInRole(member.LoginName, SpamMemberGroupName))
member.RemoveGroup(memberGroup.Id);
}