Exemplo n.º 1
0
        public static ExtList <PatriarchObj> GetPatriarchsLinks(IBaseContext context,
                                                                int gensMin, bool datesCheck,
                                                                bool loneSuppress)
        {
            ExtList <PatriarchObj> patList = GetPatriarchsList(context, gensMin, datesCheck);

            IProgressController progress = AppHost.Progress;

            progress.ProgressInit(LangMan.LS(LSID.LSID_LinksSearch), patList.Count);
            try
            {
                int num2 = patList.Count;
                for (int i = 0; i < num2; i++)
                {
                    PatriarchObj patr = patList[i];

                    for (int j = i + 1; j < num2; j++)
                    {
                        PatriarchObj patr2 = patList[j];

                        GEDCOMIndividualRecord cross = TreeTools.PL_SearchDesc(patr.IRec, patr2.IRec);
                        if (cross != null)
                        {
                            patr.HasLinks  = true;
                            patr2.HasLinks = true;

                            if (cross.Sex == GEDCOMSex.svFemale)
                            {
                                patr.Links.Add(patr2);
                            }
                            else
                            {
                                patr2.Links.Add(patr);
                            }
                        }
                    }

                    progress.ProgressStep();
                }
            }
            finally
            {
                progress.ProgressDone();
            }

            if (loneSuppress)
            {
                for (int i = patList.Count - 1; i >= 0; i--)
                {
                    PatriarchObj patr = patList[i];
                    if (!patr.HasLinks)
                    {
                        patList.Delete(i);
                    }
                }
                patList.Pack();
            }

            return(patList);
        }
 public void Delete(int index)
 {
     if (index < 0 || index >= fList.Count)
     {
         throw new ListException("List index out of bounds (%d)", index);
     }
     //(this.FList[Index] as TAttribute).Dispose();
     fList.Delete(index);
 }
        public void Delete(int index)
        {
            LBColumnTitle ct = GetItem(index);

            if (ct != null)
            {
                fList.Delete(index);
            }
        }
Exemplo n.º 4
0
        public void Delete(int Index)
        {
            Changing();
            LBItem item = GetItem(Index);

            if (item != null)
            {
                item.Dispose();
            }
            fList.Delete(Index);
            Changed();
        }
Exemplo n.º 5
0
 public void DeletePoint(int index)
 {
     fMapPoints.Delete(index);
     RefreshPoints();
 }
Exemplo n.º 6
0
 public void Delete(int index)
 {
     fList.Delete(index);
 }
Exemplo n.º 7
0
 public void DeleteDoor(int index)
 {
     fDoorList.Delete(index);
 }
 public void DeleteConversation(int index)
 {
     ((ConversationEntry)fConversations[index]).Dispose();
     fConversations.Delete(index);
 }
Exemplo n.º 9
0
        public void Test_Common()
        {
            using (ExtList <object> list = new ExtList <object>(true))
            {
                Assert.IsNotNull(list);
            }

            using (ExtList <object> list = new ExtList <object>())
            {
                Assert.IsNotNull(list);
                Assert.AreEqual(0, list.Count);

                Assert.Throws(typeof(ListException), () => { list[-1] = null; });

                object obj  = new object();
                object obj1 = new object();

                list.Add(obj);
                Assert.AreEqual(1, list.Count);
                Assert.AreEqual(obj, list[0]);
                Assert.AreEqual(0, list.IndexOf(obj));

                list.Delete(0);
                Assert.AreEqual(0, list.Count);

                list.Add(obj);
                Assert.AreEqual(obj, list.Extract(obj));

                list.Insert(0, obj);

                list[0] = obj;
                Assert.AreEqual(obj, list[0]);

                list.Add(null);
                Assert.AreEqual(2, list.Count);
                Assert.AreEqual(null, list[1]);
                list[1] = obj1;
                Assert.AreEqual(obj1, list[1]);

                list[1] = null;
                Assert.AreEqual(2, list.Count);
                list.Pack();
                Assert.AreEqual(1, list.Count);

                list.Remove(obj);
                Assert.AreEqual(0, list.Count);

                Assert.AreEqual(false, list.OwnsObjects);

                list.OwnsObjects = true;
                Assert.AreEqual(true, list.OwnsObjects);

                list.Clear();
                list.Add(obj);
                list.Add(obj1);
                Assert.AreEqual(obj, list[0]);
                Assert.AreEqual(obj1, list[1]);
                list.Exchange(0, 1);
                Assert.AreEqual(obj, list[1]);
                Assert.AreEqual(obj1, list[0]);
            }

            using (ExtList <ValItem> list = new ExtList <ValItem>())
            {
                Assert.IsNotNull(list);

                list.Add(new ValItem(5));
                list.Add(new ValItem(1));
                list.Add(new ValItem(17));
                list.Add(new ValItem(4));

                list.QuickSort(CompareItems);

                list.MergeSort(CompareItems);
            }
        }
Exemplo n.º 10
0
 public void DeleteTopic(int index)
 {
     ((TopicEntry)fTopics[index]).Dispose();
     fTopics.Delete(index);
 }