/// <summary> /// Opens a dialog for selecting users and returns the selection. /// </summary> /// <param name="conn">IndexServer connection</param> /// <param name="flags">Options</param> /// <param name="selectUserIds">List of user IDs to be selected</param> /// <param name="hideUserIds">reserved</param> /// <returns>Selected users</returns> public static IEnumerable <UserName> DoSelectUser(FWConnection conn, FormSelectUserFlags flags, IEnumerable <int> selectUserIds, IEnumerable <int> hideUserIds) { FormSelectUser frm = Create(conn, flags, selectUserIds, hideUserIds); IEnumerable <UserName> ret = null; if (frm.ShowDialog() == DialogResult.OK) { ret = frm.SelectUserControl.SelectedUsers; } return(ret); }
/// <summary> /// Create and initialize a dialog object. /// </summary> /// <param name="conn">IndexServer connection</param> /// <param name="flags">Options</param> /// <param name="selectUserIds">List of user IDs to be selected</param> /// <param name="hideUserIds">List of user IDs to be hidden</param> /// <returns>Dialog object</returns> public static FormSelectUser Create(FWConnection conn, FormSelectUserFlags flags, IEnumerable <int> selectUserIds, IEnumerable <int> hideUserIds) { FormSelectUser frm = new FormSelectUser(); frm.SelectUserControl.ShowUsers = (flags & FormSelectUserFlags.ShowUsers) != 0; frm.SelectUserControl.ShowGroups = (flags & FormSelectUserFlags.ShowGroups) != 0; frm.SelectUserControl.MultiSelect = (flags & FormSelectUserFlags.MultiSelect) != 0; frm.SelectUserControl.HiddenUserIds = hideUserIds; frm.SelectUserControl.Conn = conn; frm.SelectUserControl.SelectedUserIds = selectUserIds; return(frm); }