private void Directory_OnDirGroupsReply(object sender, DirGroupsReplyEventArgs e) { BeginInvoke(new MethodInvoker(() => { GroupsReply(e.QueryID, e.MatchedGroups); })); }
private void Directory_DirGroups(object sender, DirGroupsReplyEventArgs e) { if (e.MatchedGroups.Count > 0) { foreach (DirectoryManager.GroupSearchData group in e.MatchedGroups) { WriteLine("Group {1} ({0}) has {2} members", group.GroupID, group.GroupName, group.Members); } } else { WriteLine("Didn't find any groups that matched your query :("); } waitQuery.Set(); }
private void Directory_OnDirGroupsReply(object sender, DirGroupsReplyEventArgs e) { if (InvokeRequired) { BeginInvoke((MethodInvoker)delegate { Directory_OnDirGroupsReply(sender, e); }); return; } BeginInvoke((MethodInvoker)delegate { GroupsReply(e.QueryID, e.MatchedGroups); }); }
void Directory_DirGroupsReply(object sender, DirGroupsReplyEventArgs e) { if (e.QueryID != groupSearch) return; if (InvokeRequired) { BeginInvoke(new MethodInvoker(() => Directory_DirGroupsReply(sender, e))); return; } lvwGroups.BeginUpdate(); if (e.MatchedGroups.Count == 0) lvwGroups.Items.Clear(); foreach (DirectoryManager.GroupSearchData group in e.MatchedGroups) { if (group.GroupID == UUID.Zero) continue; ListViewItem item = new ListViewItem(); item.Name = group.GroupID.ToString(); item.Text = group.GroupName; item.Tag = group; item.SubItems.Add(new ListViewItem.ListViewSubItem(item, group.Members.ToString())); lvwGroups.Items.Add(item); } lvwGroups.Sort(); lvwGroups.EndUpdate(); groupMatches += e.MatchedGroups.Count; btnNextGroup.Enabled = groupMatches > 100; btnPrevGroup.Enabled = placeStart != 0; if (e.MatchedGroups.Count > 0 && e.MatchedGroups[e.MatchedGroups.Count - 1].GroupID == UUID.Zero) groupMatches -= 1; lblNrGroups.Visible = true; lblNrGroups.Text = string.Format("{0} groups found", groupMatches > 100 ? "More than " + (groupStart + 100).ToString() : (groupStart + groupMatches).ToString()); }
/// <summary>Raises the DirGroupsReply event</summary> /// <param name="e">A DirGroupsReplyEventArgs object containing the /// data returned from the data server</param> protected virtual void OnDirGroups(DirGroupsReplyEventArgs e) { EventHandler<DirGroupsReplyEventArgs> handler = m_DirGroups; if (handler != null) handler(this, e); }
void Directory_DirGroups(object sender, DirGroupsReplyEventArgs e) { if (queryID == e.QueryID) { queryID = UUID.Zero; if (e.MatchedGroups.Count < 1) { Console.WriteLine("ERROR: Got an empty reply"); } else { if (e.MatchedGroups.Count > 1) { /* A.Biondi * The Group search doesn't work as someone could expect... * It'll give back to you a long list of groups even if the * searchText (groupName) matches esactly one of the groups * names present on the server, so we need to check each result. * UUIDs of the matching groups are written on the console. */ Console.WriteLine("Matching groups are:\n"); foreach (DirectoryManager.GroupSearchData groupRetrieved in e.MatchedGroups) { Console.WriteLine(groupRetrieved.GroupName + "\t\t\t(" + Name + " UUID " + groupRetrieved.GroupID.ToString() + ")"); if (groupRetrieved.GroupName.ToLower() == groupName.ToLower()) { resolvedGroupID = groupRetrieved.GroupID; resolvedGroupName = groupRetrieved.GroupName; break; } } if (string.IsNullOrEmpty(resolvedGroupName)) resolvedGroupName = "Ambiguous name. Found " + e.MatchedGroups.Count.ToString() + " groups (UUIDs on console)"; } } GetGroupsSearchEvent.Set(); } }
void Directory_DirGroupsReply(object sender, DirGroupsReplyEventArgs e) { if(queryid!=e.QueryID) return; Gtk.Application.Invoke(delegate{ this.label_search_progress.Text="Returned "+e.MatchedGroups.Count.ToString()+" results"; foreach (OpenMetaverse.DirectoryManager.GroupSearchData agroup in e.MatchedGroups) { store.AppendValues(agroup.GroupName,agroup.Members.ToString(),agroup.GroupID); } }); }
public void Directory_DirGroupsReply(object sender, DirGroupsReplyEventArgs e) { Hashtable item = new Hashtable(); item.Add("MessageType", "DirGroupsReply"); List<Hashtable> results = new List<Hashtable>(); foreach (DirectoryManager.GroupSearchData group in e.MatchedGroups) { Hashtable result = new Hashtable(); result.Add("GroupID", group.GroupID); result.Add("Name", group.GroupName); result.Add("MemberCount", group.Members); results.Add(result); } item.Add("Results", results); enqueue(item); }
private void GroupSearchReply(object sender, DirGroupsReplyEventArgs e) { if (e.QueryID != QueryID) return; Importing.Client.Directory.DirGroupsReply -= GroupSearchReply; foreach (var match in e.MatchedGroups) { if (match.GroupName == NewName) { NewID = match.GroupID; return; } } WaitOnCreate.Set(); }
public virtual void Directory_OnDirGroupsReply(Object sender, DirGroupsReplyEventArgs e) { OnEvent("On-Dir-Groups-Reply", paramNamesOnDirGroupsReply, paramTypesOnDirGroupsReply, e.QueryID, e.MatchedGroups); }