コード例 #1
0
ファイル: FindGroups.cs プロジェクト: drzo/opensim4opencog
 private void Directory_OnDirGroupsReply(object sender, DirGroupsReplyEventArgs e)
 {
     BeginInvoke(new MethodInvoker(() =>
     {
         GroupsReply(e.QueryID, e.MatchedGroups);
     }));
 }
コード例 #2
0
 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();
 }
コード例 #3
0
        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); });
        }
コード例 #4
0
ファイル: SearchConsole.cs プロジェクト: nooperation/radegast
        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());
        }
コード例 #5
0
 /// <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);
 }
コード例 #6
0
ファイル: JoinGroupCommand.cs プロジェクト: RavenB/gridsearch
        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();
            }
        }
コード例 #7
0
        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);

                }
            });
        }
コード例 #8
0
ファイル: Events.cs プロジェクト: AlphaStaxLLC/AjaxLife
 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);
 }
コード例 #9
0
 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();
 }
コード例 #10
0
ファイル: AllEvents.cs プロジェクト: drzo/opensim4opencog
 public virtual void Directory_OnDirGroupsReply(Object sender, DirGroupsReplyEventArgs e) { OnEvent("On-Dir-Groups-Reply", paramNamesOnDirGroupsReply, paramTypesOnDirGroupsReply, e.QueryID, e.MatchedGroups); }