Exemplo n.º 1
0
 /// <summary>
 /// Create a new PolygonDataSet with all villages from the polygons
 /// </summary>
 public static PolygonDataSet CreateDataSet(IEnumerable<Polygon> polygons)
 {
     var ds = new PolygonDataSet();
     foreach (Polygon poly in polygons)
     {
         foreach (Village v in poly.GetVillages())
         {
             ds.AddVillageRow(v, poly);
         }
     }
     return ds;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Create a new PolygonDataSet with all villages from the polygons
        /// </summary>
        public static PolygonDataSet CreateDataSet(IEnumerable <Polygon> polygons)
        {
            var ds = new PolygonDataSet();

            foreach (Polygon poly in polygons)
            {
                foreach (Village v in poly.GetVillages())
                {
                    ds.AddVillageRow(v, poly);
                }
            }
            return(ds);
        }
Exemplo n.º 3
0
        /// <summary>
        /// BBCodeArea polygon(s) have been ported to this control
        /// </summary>
        private void EventPublisher_PolygonActivated(object sender, PolygonEventArgs e)
        {
            Polygon[] polygons = e.Polygons.ToArray();
            if (polygons.Length == 1)
            {
                // Polygon management grid: jump to the selected polygon row
                foreach (GridEXRow row in GridExPolygon.GetRows())
                {
                    if (row.RowType == RowType.Record)
                    {
                        var polygon = (Polygon)row.DataRow;
                        if (polygon.Equals(polygons[0]))
                        {
                            GridExPolygon.MoveTo(row);
                            break;
                        }
                    }
                }
            }

            GridExVillage.DataSource = PolygonDataSet.CreateDataSet(e.Polygons);
            GridExVillage.MoveFirst();
        }