MapSuiteGisEditor/WpfDesktopExtension/Shares/MapEngine.cs
/// <summary>
/// This method is a static API to get information about a group of passed-in features with the specified
/// returningColumns, in the format of a DataTable.
/// </summary>
/// <param name="features">This parameter specifies the target features.</param>
/// <param name="returningColumnNames">This parameter specifies the returning columnNames for the features.</param>
/// <returns>A DateTable of information about those passed-in features and the returning columnNames.</returns>
This method is a static API to get information about a group of passed-in features with the specified
returningColumns, in the format of a DataTable.
This method is a static API to get information about a group of passed - in features with the specified returningColumns in the format of a DataTable .
public static GeoDataTable LoadDataTable(Collection<Feature> features, IEnumerable<string> returningColumnNames)
        {
            ValidatorHelper.CheckObjectIsNotNull(returningColumnNames, "returningColumnNames");
            GeoDataTable dataTable = null;
            if (features != null)
            {
                dataTable = new GeoDataTable();
                foreach (string columnName in returningColumnNames)
                {
                    dataTable.Columns.Add(columnName);
                }
                foreach (Feature feature in features)
                {
                    Dictionary<string, object> dataRow = new Dictionary<string, object>();
                    for (int i = 0; i < dataTable.Columns.Count; i++)
                    {
                        if (feature.ColumnValues.ContainsKey(dataTable.Columns[i]))
                        {
                            dataRow.Add(dataTable.Columns[i], feature.ColumnValues[dataTable.Columns[i]]);
                        }
                        else
                        {
                            dataRow.Add(dataTable.Columns[i], string.Empty);
                        }
                    }
                    dataTable.Rows.Add(dataRow);
                }
            }
            return dataTable;
        }
public static GeoDataTable LoadDataTable ( Collection < Feature > features , IEnumerable < string > returningColumnNames ) { ValidatorHelper . CheckObjectIsNotNull ( returningColumnNames , " " ) ; GeoDataTable dataTable = null ; if ( features != null ) { dataTable = new GeoDataTable ( ) ; foreach ( string columnName in returningColumnNames ) { dataTable . Columns . Add ( columnName ) ; } foreach ( Feature feature in features ) { Dictionary < string , object > dataRow = new Dictionary < string , object > ( ) ; for ( int i = 0 ; i < dataTable . Columns . Count ; i ++ ) { if ( feature . ColumnValues . ContainsKey ( dataTable . Columns [ i ] ) ) { dataRow . Add ( dataTable . Columns [ i ] , feature . ColumnValues [ dataTable . Columns [ i ] ] ) ; } else { dataRow . Add ( dataTable . Columns [ i ] , string . Empty ) ; } } dataTable . Rows . Add ( dataRow ) ; } } return dataTable ; }
This method is a static API to get information about a group of passed-in features with the specified
returningColumns, in the format of a DataTable.
This method is a static API to get information about a group of passed - in features with the specified returningColumns in the format of a DataTable .
A DateTable of information about those passed-in features and the returning columnNames.
A DateTable of information about those passed - in features and the returning columnNames .
features
Collection<Feature>
This parameter specifies the target features.
This parameter specifies the target features .
returningColumnNames
IEnumerable<string>
This parameter specifies the returning columnNames for the features.
This parameter specifies the returning columnNames for the features .