Exemplo n.º 1
0
        void update_list()
        {
            ParcelList.Items.Clear();

            List <Parcel> parcels = Session.Project.TreasureParcels;

            foreach (Parcel parcel in parcels)
            {
                string       name = (parcel.Name != "") ? parcel.Name : "(undefined parcel)";
                ListViewItem lvi  = ParcelList.Items.Add(name);
                lvi.SubItems.Add(parcel.Details);
                lvi.Tag = parcel;

                int group_index = (parcel.MagicItemID != Guid.Empty) ? 0 : 1;
                lvi.Group = ParcelList.Groups[group_index];
            }

            ParcelList.Sort();
        }
Exemplo n.º 2
0
        void update_list()
        {
            ParcelList.BeginUpdate();
            ParcelList.Items.Clear();

            if (fViewAssigned)
            {
                List <PlotPoint> all_points = Session.Project.AllPlotPoints;
                foreach (PlotPoint pp in all_points)
                {
                    add_list(pp.Parcels, 0);
                }
            }

            if (fViewUnassigned)
            {
                add_list(Session.Project.TreasureParcels, 1);
            }

            if ((fViewAssigned) && (ParcelList.Groups[0].Items.Count == 0))
            {
                ListViewItem lvi = ParcelList.Items.Add("(no parcels)");
                lvi.ForeColor = SystemColors.GrayText;
                lvi.Group     = ParcelList.Groups[0];
            }

            if ((fViewUnassigned) && (ParcelList.Groups[1].Items.Count == 0))
            {
                ListViewItem lvi = ParcelList.Items.Add("(no parcels)");
                lvi.ForeColor = SystemColors.GrayText;
                lvi.Group     = ParcelList.Groups[1];
            }

            ParcelList.Sort();
            ParcelList.EndUpdate();
        }