示例#1
0
        private void btnPatSearch_Click(object sender, EventArgs e)
        {
            ListPatriarchs.BeginUpdate();
            ExtList <PatriarchObj> lst = null;

            try
            {
                ListPatriarchs.ClearItems();
                lst = PatriarchsMan.GetPatriarchsList(fBase.Context,
                                                      (int)edMinGens.Value, !chkWithoutDates.Checked.GetValueOrDefault());
                lst.QuickSort(PatriarchsCompare);

                int num = lst.Count;
                for (int i = 0; i < num; i++)
                {
                    PatriarchObj pObj  = lst[i];
                    string       pSign = ((pObj.IRec.Patriarch) ? "[*] " : "");

                    ListPatriarchs.AddItem(pObj.IRec, new object[] { pSign + GKUtils.GetNameString(pObj.IRec, true, false),
                                                                     pObj.BirthYear,
                                                                     pObj.DescendantsCount,
                                                                     pObj.DescGenerations });
                }
            }
            finally
            {
                if (lst != null)
                {
                    lst.Dispose();
                }
                ListPatriarchs.EndUpdate();
            }
        }
示例#2
0
        private void CheckBase()
        {
            TreeTools.CheckBase(fBase, fChecksList);

            ListChecks.ClearItems();

            foreach (TreeTools.CheckObj checkObj in fChecksList)
            {
                ListChecks.AddItem(checkObj, false, checkObj.GetRecordName(),
                                   checkObj.Comment,
                                   LangMan.LS(GKData.CheckSolveNames[(int)checkObj.Solve]));
            }

            //ListChecks.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
        }
示例#3
0
        private void CheckPlaces()
        {
            ListPlaces.BeginUpdate();
            try
            {
                TreeTools.SearchPlaces(fTree, fPlaces, AppHost.Progress);

                ListPlaces.ClearItems();

                int num4 = fPlaces.Count;
                for (int i = 0; i < num4; i++)
                {
                    PlaceObj placeObj = (PlaceObj)fPlaces.GetObject(i);

                    ListPlaces.AddItem(placeObj, new object[] { fPlaces[i], placeObj.Facts.Count });
                }
            }
            finally
            {
                ListPlaces.EndUpdate();
            }
        }
示例#4
0
        private void CalcStats(StatsMode mode)
        {
            fListStats.SetColumnCaption(0, LangMan.LS(GKData.StatsTitles[(int)mode].Cap));
            fListStats.SetColumnCaption(1, LangMan.LS(LSID.LSID_Value));

            fListStats.SortOrder  = SortOrder.None;
            fListStats.SortColumn = -1;
            fListStats.Sorting    = true;

            fListStats.BeginUpdate();
            List <StatsItem> vals = new List <StatsItem>();

            try {
                fTreeStats.GetSpecStats(mode, vals);
                fCurrentValues = vals;

                fListStats.ClearItems();
                foreach (StatsItem lv in vals)
                {
                    string stVal = lv.GetDisplayString();
                    fListStats.AddItem(null, lv.Caption, stVal);
                }
            } finally {
                fListStats.EndUpdate();
            }

            fChartTitle = LangMan.LS(GKData.StatsTitles[(int)mode].Title);

            switch (mode)
            {
            case StatsMode.smAge:
                fChartXTitle = LangMan.LS(LSID.LSID_Age);
                fChartYTitle = LangMan.LS(LSID.LSID_People);
                PrepareArray(ChartStyle.Point, true);
                break;

            case StatsMode.smLifeExpectancy:
                fChartXTitle = LangMan.LS(LSID.LSID_LifeExpectancy);
                fChartYTitle = LangMan.LS(LSID.LSID_People);
                PrepareArray(ChartStyle.Point, true);
                break;

            case StatsMode.smBirthYears:
            case StatsMode.smBirthTenYears:
            case StatsMode.smDeathYears:
            case StatsMode.smDeathTenYears:
            {
                switch (mode)
                {
                case StatsMode.smBirthYears:
                case StatsMode.smDeathYears:
                    fChartXTitle = LangMan.LS(LSID.LSID_Years);
                    break;

                case StatsMode.smBirthTenYears:
                case StatsMode.smDeathTenYears:
                    fChartXTitle = LangMan.LS(LSID.LSID_Decennial);
                    break;
                }

                switch (mode)
                {
                case StatsMode.smBirthYears:
                case StatsMode.smBirthTenYears:
                    fChartYTitle = LangMan.LS(LSID.LSID_HowBirthes);
                    break;

                case StatsMode.smDeathYears:
                case StatsMode.smDeathTenYears:
                    fChartYTitle = LangMan.LS(LSID.LSID_HowDeads);
                    break;
                }

                PrepareArray(ChartStyle.Point, true);
                break;
            }

            case StatsMode.smChildsDistribution:
                fChartXTitle = LangMan.LS(LSID.LSID_Childs);
                fChartYTitle = LangMan.LS(LSID.LSID_Parents);
                PrepareArray(ChartStyle.Bar, true);
                break;

            case StatsMode.smCertaintyIndex:
                fChartXTitle = LangMan.LS(LSID.LSID_CertaintyIndex);
                fChartYTitle = LangMan.LS(LSID.LSID_People);
                PrepareArray(ChartStyle.Bar, true);
                break;

            case StatsMode.smBirthByMonth:
                fChartXTitle = LangMan.LS(LSID.LSID_Month);
                fChartYTitle = LangMan.LS(LSID.LSID_People);
                PrepareArray(ChartStyle.Bar, true);
                break;

            case StatsMode.smDemography:
                fChartXTitle = LangMan.LS(LSID.LSID_LifeExpectancy);
                fChartYTitle = LangMan.LS(LSID.LSID_People);
                PrepareArray(ChartStyle.ClusterBar, true, vals);
                break;

            default:
                fGraph.Clear();
                break;
            }
        }