예제 #1
0
        private void GroupsReply(UUID qqueryID, List <DirectoryManager.GroupSearchData> matchedGroups)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(delegate()
                {
                    GroupsReply(qqueryID, matchedGroups);
                }));

                return;
            }

            if (qqueryID != this.queryID)
            {
                return;
            }

            lvwFindGroups.BeginUpdate();

            foreach (DirectoryManager.GroupSearchData group in matchedGroups)
            {
                if (!findGroupsResults.ContainsKey(group.GroupName))
                {
                    findGroupsResults.Add(group.GroupName, group.GroupID);
                }

                ListViewItem item = lvwFindGroups.Items.Add(group.GroupName);
                item.Tag = group.GroupID;
                item.SubItems.Add("Total " + group.Members.ToString(CultureInfo.CurrentCulture) + " members");
            }

            lvwFindGroups.Sort();
            lvwFindGroups.EndUpdate();
            pGroups.Visible = false;
        }
예제 #2
0
        private void UpdateNames()
        {
            if (this.InvokeRequired)
            {
                Invoke(new MethodInvoker(UpdateNames));
                return;
            }
            else
            {
                lock (Names)
                {
                    lock (MemberData)
                    {
                        foreach (KeyValuePair <UUID, string> nname in Names)
                        {
                            if (!MemberData.ContainsKey(nname.Key))
                            {
                                MemberData[nname.Key] = new GroupMemberData();
                            }

                            MemberData[nname.Key].Name = nname.Value;
                        }
                    }
                }

                UpdateMemberList();
            }
        }
예제 #3
0
 private void AddSortMethod(ITreeSortMethod sort)
 {
     if (!sortMethods.ContainsKey(sort.Name))
     {
         sortMethods.Add(sort.Name, sort);
     }
 }
예제 #4
0
        //UI thread
        private void EventsReply(UUID qqueryID, List <DirectoryManager.EventsSearchData> matchedEvents)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(delegate()
                {
                    EventsReply(qqueryID, matchedEvents);
                }));

                return;
            }

            if (qqueryID != this.queryID)
            {
                return;
            }

            lvwFindEvents.BeginUpdate();

            int icnt = 0;

            foreach (DirectoryManager.EventsSearchData events in matchedEvents)
            {
                try
                {
                    string fullName = events.Name;
                    bool   fx       = false;

                    if (findEventsResults.ContainsKey(fullName))
                    {
                        fx = true;
                    }

                    if (!fx)
                    {
                        findEventsResults.Add(fullName, events.ID);
                    }
                    else
                    {
                        fullName += " (" + icnt.ToString(CultureInfo.CurrentCulture) + ")";
                        findEventsResults.Add(fullName, events.ID);
                    }

                    ListViewItem item = lvwFindEvents.Items.Add(fullName);
                    item.SubItems.Add(events.Date);   // + "-" + events.Time);
                }
                catch
                {
                    ;
                }

                icnt += 1;
            }

            lvwFindEvents.Sort();
            lvwFindEvents.EndUpdate();
            pEvents.Visible = false;
        }
예제 #5
0
        private void PlacesReply(UUID qqueryID, List <DirectoryManager.DirectoryParcel> matchedPlaces)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => PlacesReply(qqueryID, matchedPlaces)));
                return;
            }

            if (qqueryID != this.queryID)
            {
                return;
            }

            lvwFindPlaces.BeginUpdate();

            int icnt = 0;

            foreach (DirectoryManager.DirectoryParcel places in matchedPlaces)
            {
                try
                {
                    string fullName = places.Name;
                    bool   fx       = false;

                    if (findPlacesResults.ContainsKey(fullName))
                    {
                        //DirectoryManager.DirectoryParcel pcl = findPlacesResults[fullName];
                        fx = true;
                    }

                    if (!fx)
                    {
                        findPlacesResults.Add(fullName, places);
                    }
                    else
                    {
                        fullName += " (" + icnt.ToString(CultureInfo.CurrentCulture) + ")";
                        findPlacesResults.Add(fullName, places);
                    }

                    ListViewItem item = lvwFindPlaces.Items.Add(fullName);
                    item.SubItems.Add(places.Dwell.ToString(CultureInfo.CurrentCulture));   // + "-" + events.Time);
                }
                catch
                {
                    ;
                }

                icnt += 1;
            }

            lvwFindPlaces.Sort();
            lvwFindPlaces.EndUpdate();
            pPlaces.Visible = false;
        }
예제 #6
0
        //UI thread
        private void PeopleReply(UUID qqueryID, List <DirectoryManager.AgentSearchData> matchedPeople)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(delegate()
                {
                    PeopleReply(qqueryID, matchedPeople);
                }));

                return;
            }

            if (qqueryID != this.queryID)
            {
                return;
            }

            lvwFindPeople.BeginUpdate();

            foreach (DirectoryManager.AgentSearchData person in matchedPeople)
            {
                string fullName = person.FirstName + " " + person.LastName;

                if (!findPeopleResults.ContainsKey(fullName))
                {
                    findPeopleResults.Add(fullName, person.AgentID);
                }

                ListViewItem item = lvwFindPeople.Items.Add(fullName);
                item.SubItems.Add(person.Online ? "Yes" : "No");
            }

            lvwFindPeople.Sort();
            lvwFindPeople.EndUpdate();
            pPeople.Visible = false;
        }
예제 #7
0
        private void GetHistory()
        {
            string folder = instance.Config.CurrentConfig.LogDir;

            if (!folder.EndsWith("\\", StringComparison.CurrentCultureIgnoreCase))
            {
                folder += "\\";
            }

            DirectoryInfo di = new DirectoryInfo(folder);

            FileSystemInfo[] files = di.GetFileSystemInfos();

            Array.Sort(files, CompareFileByDate);
            Array.Reverse(files);   // Descending

            lvwList.Items.Clear();

            foreach (FileSystemInfo fi in files)
            {
                string inFile  = fi.FullName;
                string finname = fi.Name;

                if (finname.Contains(filename))
                {
                    if (isgroup)
                    {
                        if (finname.Contains("-GROUP-"))
                        {
                            if (finname.Contains(client.Self.Name))
                            {
                                string   filedate = string.Empty;
                                string[] file     = finname.Split('-');

                                filedate = file[1].Trim() + "/" + file[2].Trim() + "/" + file[3].Substring(0, 4).Trim();

                                ffiles.Add(filedate, inFile);
                                lvwList.Items.Add(filedate);
                            }
                        }
                    }
                    else
                    {
                        if (!finname.Contains("-GROUP-"))
                        {
                            if (finname.Contains(client.Self.Name))
                            {
                                string   filedate = string.Empty;
                                string[] file     = finname.Split('-');

                                filedate = file[1].Trim() + "/" + file[2].Trim() + "/" + file[3].Substring(0, 4).Trim();

                                ffiles.Add(filedate, inFile);
                                lvwList.Items.Add(filedate);
                            }
                        }
                    }
                }
            }

            if (ffiles.Count() == 0)
            {
                label1.Text = "History for " + filename + " doesn't exist";
                return;
            }

            label1.Visible = false;

            lvwList.Sort();

            try
            {
                if (ffiles.ContainsKey(lvwList.Items[0].Text))
                {
                    GetFile(ffiles[lvwList.Items[0].Text]);
                }
            }
            catch
            {
                ;
            }
        }
예제 #8
0
        private void Self_OnChatSessionMemberAdded(object sender, ChatSessionMemberAddedEventArgs e)
        {
            if (e.SessionID != session)
            {
                return;
            }

            try
            {
                if (people == null)
                {
                    BeginInvoke(new MethodInvoker(delegate()
                    {
                        if (!lvwList.Items.ContainsKey(e.AgentID.ToString()))
                        {
                            ListViewItem item = lvwList.Items.Add(e.AgentID.ToString());
                            item.Tag          = e;
                        }
                    }));

                    if (!people.ContainsKey(e.AgentID))
                    {
                        lock (people)
                        {
                            people.Add(e.AgentID, string.Empty);
                        }

                        client.Avatars.RequestAvatarName(e.AgentID);
                    }

                    return;
                }

                if (!people.ContainsKey(e.AgentID))
                {
                    BeginInvoke(new MethodInvoker(delegate()
                    {
                        if (!lvwList.Items.ContainsKey(e.AgentID.ToString()))
                        {
                            ListViewItem item = lvwList.Items.Add(e.AgentID.ToString());
                            item.Tag          = e;
                        }
                    }));

                    if (!people.ContainsKey(e.AgentID))
                    {
                        lock (people)
                        {
                            people.Add(e.AgentID, string.Empty);
                        }
                    }

                    client.Avatars.RequestAvatarName(e.AgentID);
                }
                else
                {
                    BeginInvoke(new MethodInvoker(delegate()
                    {
                        if (!lvwList.Items.ContainsKey(people[e.AgentID]))
                        {
                            ListViewItem item = lvwList.Items.Add(people[e.AgentID]);
                            item.Tag          = e;
                            lvwList.Sort();
                        }
                    }));
                }
            }
            catch {; }
        }
예제 #9
0
        private void LandReply(List <DirectoryManager.DirectoryParcel> matchedPlaces)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => LandReply(matchedPlaces)));
                return;
            }

            //if (queryID != this.queryID) return;

            lvwFindLand.BeginUpdate();

            int icnt = 0;

            foreach (DirectoryManager.DirectoryParcel places in matchedPlaces)
            {
                try
                {
                    string fullName = places.Name;
                    bool   fx       = false;

                    if (findLandResults.ContainsKey(fullName))
                    {
                        //DirectoryManager.DirectoryParcel pcl = findLandResults[fullName];
                        fx = true;
                    }

                    if (!fx)
                    {
                        findLandResults.Add(fullName, places);
                    }
                    else
                    {
                        fullName += " (" + icnt.ToString(CultureInfo.CurrentCulture) + ")";
                        findLandResults.Add(fullName, places);
                    }

                    //ListViewItem item = lvwFindLand.Items.Add(fullName);
                    //item.SubItems.Add(places.ActualArea.ToString());
                    //item.SubItems.Add(places.SalePrice.ToString());

                    //double pricesqm = (Convert.ToDouble(places.SalePrice) / Convert.ToDouble(places.ActualArea));
                    //item.SubItems.Add(pricesqm.ToString("N2"));
                }
                catch
                {
                    ;
                }

                icnt += 1;
            }

            var items = from k in findLandResults.Keys
                        orderby(Convert.ToDouble(findLandResults[k].SalePrice) / Convert.ToDouble(findLandResults[k].ActualArea)) ascending
                        select k;

            foreach (string k in items)
            {
                ListViewItem item = lvwFindLand.Items.Add(k);
                item.SubItems.Add(findLandResults[k].ActualArea.ToString(CultureInfo.CurrentCulture));
                item.SubItems.Add(findLandResults[k].SalePrice.ToString(CultureInfo.CurrentCulture));

                double pricesqm = (Convert.ToDouble(findLandResults[k].SalePrice) / Convert.ToDouble(findLandResults[k].ActualArea));
                item.SubItems.Add(pricesqm.ToString("N3", CultureInfo.CurrentCulture));
            }

            //lvwFindLand.Sort();
            lvwFindLand.EndUpdate();
            pLand.Visible = false;
        }
예제 #10
0
 public bool ContainsImage(UUID imageID)
 {
     return(cache.ContainsKey(imageID));
 }