IUserGroupListService Interface
Provides a list of user groups to fill the Editing Permissions form.
Namespace: DevExpress.XtraRichEdit.Services
Assembly:
DevExpress.RichEdit.v24.1.Core.dll
NuGet Packages:
DevExpress.RichEdit.Core, DevExpress.Win.Navigation
Declaration
[ComVisible(true)]
public interface IUserGroupListService
<ComVisible(True)>
Public Interface IUserGroupListService
The service can be used to fill the Editing Permissions Dialog at runtime. See the Range Permissions document for more information.
The code sample illustrates how to implement the IUserGroupListService
interface in your application.
User name and group membership are represented by the MyUser object instance. When the MyGroupListService service is instantiated, it obtains a list of groups and stores the list in a local variable. The IUserGroupListService.GetUserGroups method provides a list of user groups upon request.
By default, the available groups should be: Everyone, Administrators, Contributors, Owners, Editors, and Current User. Groups other than Everyone have no special meaning. Use DOCX format to save documents containing user and group permissions. Note that only default group names are saved in a document in RTF format. DOC format cannot be used to retain group permissions.
class MyGroupListService : DevExpress.XtraRichEdit.Services.IUserGroupListService
{
List<string> userGroups = CreateUserGroups();
static List<string> CreateUserGroups()
{
List<string> result = new List<string>();
result.Add(@"Everyone");
result.Add(@"Administrators");
result.Add(@"Contributors");
result.Add(@"Owners");
result.Add(@"Editors");
result.Add(@"Current User");
result.Add("Skywalkers");
result.Add("Nihlus");
return result;
}
public IList<string> GetUserGroups()
{
return userGroups;
}
}
public class MyUser
{
public MyUser(string s)
{
UserName = s;
Group = String.Empty;
}
public MyUser(string s1, string s2)
{
UserName = s1;
Group = s2;
}
public string UserName { get; set; }
public string Group { get; set; }
}
Friend Class MyGroupListService
Implements DevExpress.XtraRichEdit.Services.IUserGroupListService
Private userGroups As List(Of String) = CreateUserGroups()
Private Shared Function CreateUserGroups() As List(Of String)
Dim result As New List(Of String)()
result.Add("Everyone")
result.Add("Administrators")
result.Add("Contributors")
result.Add("Owners")
result.Add("Editors")
result.Add("Current User")
result.Add("Skywalkers")
result.Add("Nihlus")
Return result
End Function
Public Function GetUserGroups() As IList(Of String) Implements DevExpress.XtraRichEdit.Services.IUserGroupListService.GetUserGroups
Return userGroups
End Function
End Class
Public Class MyUser
Public Sub New(ByVal s As String)
UserName = s
Group = String.Empty
End Sub
Public Sub New(ByVal s1 As String, ByVal s2 As String)
UserName = s1
Group = s2
End Sub
Public Property UserName() As String
Public Property Group() As String
End Class
See Also