Exemple #1
0
        /// <summary>
        /// Get the KeyProperty corresponding to the bandIndex and 'key' from the dataset.
        /// </summary>
        /// <param name="dataset">Dataset to get the property from.</param>
        /// <param name="key">The key for which to get the value.</param>
        /// <param name="bandIndex">Band for which to get the property.</param>
        /// <returns>Property corresponding to the key or null if none found.</returns>
        static object GetBandProperty(IDataset dataset, string key, int bandIndex)
        {
            IRasterKeyProperties rasterKeyProps = (IRasterKeyProperties)dataset;
            object value = null;

            try { value = rasterKeyProps.GetBandProperty(key, bandIndex); }
            catch (Exception) { }

            return(value);
        }
Exemple #2
0
        /// <summary>
        /// Set the KeyProperty corresponding to the bandIndex and 'key' from the dataset.
        /// </summary>
        /// <param name="dataset">Dataset to set the property on.</param>
        /// <param name="key">The key on which to set the property.</param>
        /// <param name="bandIndex">Band from which to get the property.</param>
        /// <param name="value">The value to set.</param>
        static void SetBandProperty(IDataset dataset, string key, int bandIndex, object value)
        {
            IRasterKeyProperties rasterKeyProps = (IRasterKeyProperties)dataset;

            rasterKeyProps.SetBandProperty(key, bandIndex, value);
        }
Exemple #3
0
        /// <summary>
        /// Get all the properties associated with a particular band of the dataset.
        /// </summary>
        /// <param name="dataset">Dataset to get the property from.</param>
        /// <param name="bandIndex">band for which to get all properties.</param>
        /// <param name="bandKeys">String Array passed in by reference to fill with all keys.</param>
        /// <param name="bandProperties">Object array passed in by reference to fill with all properties.</param>
        static void GetAllBandProperties(IDataset dataset, int bandIndex, ref IStringArray bandKeys, ref IVariantArray bandProperties)
        {
            IRasterKeyProperties rasterKeyProps = (IRasterKeyProperties)dataset;

            rasterKeyProps.GetAllBandProperties(bandIndex, out bandKeys, out bandProperties);
        }
Exemple #4
0
        /// <summary>
        /// Set the Key Property 'value' corresponding to the key 'key' on the dataset.
        /// </summary>
        /// <param name="dataset">Dataset to set the property on.</param>
        /// <param name="key">The key on which to set the property.</param>
        /// <param name="value">The value to set.</param>
        static void SetKeyProperty(IDataset dataset, string key, object value)
        {
            IRasterKeyProperties rasterKeyProps = (IRasterKeyProperties)dataset;

            rasterKeyProps.SetProperty(key, value);
        }
Exemple #5
0
        /// <summary>
        /// Get all the properties associated with the dataset.
        /// </summary>
        /// <param name="dataset">Dataset to get the property from.</param>
        /// <param name="allKeys">String Array passed in by reference to fill with all keys.</param>
        /// <param name="allProperties">Object array passed in by reference to fill with all properties.</param>
        static void GetAllProperties(IDataset dataset, ref IStringArray allKeys, ref IVariantArray allProperties)
        {
            IRasterKeyProperties rasterKeyProps = (IRasterKeyProperties)dataset;

            rasterKeyProps.GetAllProperties(out allKeys, out allProperties);
        }