private void Directory_OnDirPlacesReply(object sender, DirPlacesReplyEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke((MethodInvoker)delegate { Directory_OnDirPlacesReply(sender, e); });
                return;
            }

            BeginInvoke((MethodInvoker)delegate { PlacesReply(e.QueryID, e.MatchedParcels); });
        }
 /// <summary>Raises the DirPlacesReply event</summary>
 /// <param name="e">A DirPlacesReplyEventArgs object containing the
 /// data returned from the data server</param>
 protected virtual void OnDirPlaces(DirPlacesReplyEventArgs e)
 {
     EventHandler<DirPlacesReplyEventArgs> handler = m_DirPlaces;
     if (handler != null)
         handler(this, e);
 }
        void Directory_DirPlacesReply(object sender, DirPlacesReplyEventArgs e)
        {
            if (e.QueryID != placeSearch) return;

            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Directory_DirPlacesReply(sender, e)));
                return;
            }

            lvwPlaces.BeginUpdate();

            if (e.MatchedParcels.Count == 0)
                lvwPlaces.Items.Clear();

            foreach (DirectoryManager.DirectoryParcel parcel in e.MatchedParcels)
            {
                if (parcel.ID == UUID.Zero) continue;

                ListViewItem item = new ListViewItem();
                item.Name = parcel.ID.ToString();
                item.Text = parcel.Name;
                item.Tag = parcel;
                item.SubItems.Add(new ListViewItem.ListViewSubItem(item, parcel.Dwell.ToString()));
                lvwPlaces.Items.Add(item);
            }
            lvwPlaces.Sort();
            lvwPlaces.EndUpdate();

            placeMatches += e.MatchedParcels.Count;

            btnNextPlace.Enabled = placeMatches > 100;
            btnPrevPlace.Enabled = placeStart != 0;

            if (e.MatchedParcels.Count > 0 && e.MatchedParcels[e.MatchedParcels.Count - 1].ID == UUID.Zero)
                placeMatches -= 1;

            lblNrPlaces.Visible = true;
            lblNrPlaces.Text = string.Format("{0} places found", placeMatches > 100 ? "More than " + (placeStart + 100).ToString() : (placeStart + placeMatches).ToString());
        }
Exemple #4
0
 public virtual void Directory_OnPlacesReply(Object sender, DirPlacesReplyEventArgs e) { OnEvent("On-Places-Reply", paramNamesOnPlacesReply, paramTypesOnPlacesReply, e.QueryID, e.MatchedParcels); }