Exemplo n.º 1
0
        /// <summary>
        /// Returns indices of shapes to be passed to insert or update routine
        /// </summary>
        private int[] GetShapefileIndices(MapWinGIS.Shapefile sf, bool selectedOnly)
        {
            int size = selectedOnly ? sf.NumSelected : sf.NumShapes;

            if (size == 0)
            {
                return(null);
            }

            int[] indices = new int[size];

            if (selectedOnly)
            {
                int count = 0;
                for (int i = 0; i < size; i++)
                {
                    if (sf.get_ShapeSelected(i))
                    {
                        indices[count++] = i;
                    }
                }
            }
            else
            {
                for (int i = 0; i < size; i++)
                {
                    indices[i] = i;
                }
            }
            return(indices);
        }