public void TreeViewSelectionEnumerator_Reset_Equal()
        {
            IFeatureClass testClass = base.Workspace.GetFeatureClass("TRANSFORMER", true);

            Assert.IsNotNull(testClass);

            IQueryFilter filter = new QueryFilterClass();

            filter.WhereClause = "OBJECTID < 10";

            var list       = testClass.Fetch(filter);
            var enumerator = new TreeViewSelection(list);

            ID8GeoAssoc x = enumerator.Next as ID8GeoAssoc;

            Assert.IsNotNull(x);

            enumerator.Reset();

            ID8GeoAssoc y = enumerator.Next as ID8GeoAssoc;

            Assert.IsNotNull(y);

            Assert.AreEqual(x.TableName, y.TableName);
            Assert.AreEqual(x.OID, y.OID);
        }
Example #2
0
        public void IRow_GetValue_FieldModelName_IndexOutOfRangeException()
        {
            IFeatureClass testClass = base.GetTestClass();
            IFeature      feature   = testClass.Fetch(1);

            Assert.IsNotNull(feature);

            object value = feature.GetValue("@%4123%1", string.Empty, false);

            Assert.AreEqual(string.Empty, value);
        }
Example #3
0
        public void IRow_GetValue_FieldModelName_IsNotNull()
        {
            IFeatureClass testClass = base.GetTestClass();
            IFeature      feature   = testClass.Fetch(1);

            Assert.IsNotNull(feature);

            object value = feature.GetValue("FEEDERID", string.Empty, false);

            Assert.IsNotNull(value);
        }
Example #4
0
        public void IRow_GetValue_FieldModelName_MissingFieldModelNameException()
        {
            IFeatureClass testClass = base.GetTestClass();
            IFeature      feature   = testClass.Fetch(1);

            Assert.IsNotNull(feature);

            object value = feature.GetValue("@%4123%1", string.Empty, true);

            Assert.IsNotNull(value);
        }
Example #5
0
        /// <summary>
        ///     Queries for the all features and executes the specified <paramref name="action" /> on each feature returned from
        ///     the query.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="action">The action to take for each feature in the cursor.</param>
        /// <param name="recycling">
        ///     if set to <c>true</c> when the cursor rehydrates a single row object on each fetch and can be
        ///     used to optimize read-only access.
        /// </param>
        /// <returns>
        ///     Returns a <see cref="int" /> representing the number of features affected by the action.
        /// </returns>
        /// <exception cref="System.ArgumentNullException">action</exception>
        /// <exception cref="ArgumentNullException">action</exception>
        /// <remarks>
        ///     Uses a recycling cursors rehydrate a single feature object on each fetch and can be used to optimize read-only
        ///     access
        /// </remarks>
        public static int Fetch(this IFeatureClass source, Func <IFeature, bool> action, bool recycling)
        {
            if (source == null)
            {
                return(0);
            }
            if (action == null)
            {
                throw new ArgumentNullException("action");
            }

            IQueryFilter filter = new QueryFilterClass();

            return(source.Fetch(filter, action, recycling));
        }
        public void TreeViewSelectionEnumerator_Next_IsTrue()
        {
            IFeatureClass testClass = base.Workspace.GetFeatureClass("TRANSFORMER", true);

            Assert.IsNotNull(testClass);

            IQueryFilter filter = new QueryFilterClass();

            filter.WhereClause = "OBJECTID < 10";

            var list       = testClass.Fetch(filter);
            var enumerator = new TreeViewSelection(list);

            ID8ListItem item = enumerator.Next;

            Assert.IsTrue(item is ID8Feature);
        }
        public void TreeViewSelectionEnumerator_EOF_IsTrue()
        {
            IFeatureClass testClass = base.Workspace.GetFeatureClass("TRANSFORMER", true);

            Assert.IsNotNull(testClass);

            IQueryFilter filter = new QueryFilterClass();

            filter.WhereClause = "OBJECTID < 10";

            var list       = testClass.Fetch(filter);
            var enumerator = new TreeViewSelection(list);

            while ((enumerator.Next) != null)
            {
            }

            Assert.IsTrue(enumerator.EOF);
        }
Example #8
0
 /// <summary>
 ///     Queries for the features that satisfies the attribute and/or spatial query as specified by an
 ///     <paramref name="filter" /> object
 ///     and executes the specified <paramref name="action" /> on each feature returned from the query.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="filter">The attribute and/or spatial requirement that the features must satisify.</param>
 /// <param name="action">The action to take for each feature in the cursor.</param>
 /// <param name="recycling">if set to <c>true</c> when a recycling memory for the features is used.</param>
 /// <returns>
 ///     Returns a <see cref="int" /> representing the number of features affected by the action.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">action</exception>
 /// <exception cref="ArgumentNullException">action</exception>
 public static int FetchAsync(this IFeatureClass source, IQueryFilter filter, Func <IFeature, bool> action, bool recycling)
 {
     return(Task.Wait(() => source.Fetch(filter, action, recycling)));
 }
Example #9
0
 /// <summary>
 ///     Queries for the features that satisfies the attribute and/or spatial query as specified by an
 ///     <paramref name="filter" /> object
 ///     and executes the specified <paramref name="action" /> on each feature returned from the query.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="filter">The attribute and/or spatial requirement that the features must satisify.</param>
 /// <param name="action">The action to take for each feature in the cursor.</param>
 /// <returns>
 ///     Returns a <see cref="int" /> representing the number of features affected by the action.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">action</exception>
 /// <exception cref="ArgumentNullException">action</exception>
 public static int Fetch(this IFeatureClass source, IQueryFilter filter, Func <IFeature, bool> action)
 {
     return(source.Fetch(filter, action, true));
 }
Example #10
0
 /// <summary>
 ///     Queries for the all features and executes the specified <paramref name="action" /> on each feature returned from
 ///     the query.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="action">The action to take for each feature in the cursor.</param>
 /// <returns>
 ///     Returns a <see cref="int" /> representing the number of features affected by the action.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">action</exception>
 /// <exception cref="ArgumentNullException">action</exception>
 /// <remarks>
 ///     Uses a recycling cursors rehydrate a single feature object on each fetch and can be used to optimize read-only
 ///     access
 /// </remarks>
 public static int Fetch(this IFeatureClass source, Func <IFeature, bool> action)
 {
     return(source.Fetch(action, true));
 }
Example #11
0
 /// <summary>
 ///     Queries for the features that have the specified object ids and projects the results into a new form.
 /// </summary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="source">The source.</param>
 /// <param name="selector">Projects each element of a sequence into a new form.</param>
 /// <param name="oids">The list of object ids.</param>
 /// <returns>
 ///     Returns a <see cref="List{TResult}" /> representing the results of the query projected to the type.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">
 ///     selector
 ///     or
 ///     oids
 /// </exception>
 public static IList <TResult> FetchAsync <TResult>(this IFeatureClass source, Func <IFeature, TResult> selector, params int[] oids)
 {
     return(Task.Wait(() => source.Fetch(selector, oids)));
 }
Example #12
0
 /// <summary>
 ///     Queries for the features that have the specified object ids.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="oids">The list of object ids.</param>
 /// <returns>
 ///     Returns a <see cref="List{IFeature}" /> representing the features returned from the query.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">oids</exception>
 public static IList <IFeature> FetchAsync(this IFeatureClass source, params int[] oids)
 {
     return(Task.Wait(() => source.Fetch(oids)));
 }
Example #13
0
 /// <summary>
 ///     Queries for the features that satisfies the attribute and/or spatial query as specified by an
 ///     <paramref name="filter" /> object.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="filter">The attribute and/or spatial requirement that the features must satisify.</param>
 /// <returns>
 ///     Returns a <see cref="List{IFeature}" /> representing the results of the query projected to the type.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">filter</exception>
 public static IList <IFeature> FetchAsync(this IFeatureClass source, IQueryFilter filter)
 {
     return(Task.Wait(() => source.Fetch(filter)));
 }
Example #14
0
 /// <summary>
 ///     Returns the row from the <paramref name="source" /> with the specified <paramref name="oid" /> when feature row
 ///     doesn't
 ///     exist it will return <c>null</c>.
 /// </summary>
 /// <param name="source">The table.</param>
 /// <param name="oid">The key for the feature in the table.</param>
 /// <returns>
 ///     Returns an <see cref="IFeature" /> representing the feature for the oid; otherwise <c>null</c>
 /// </returns>
 public static IFeature FetchAsync(this IFeatureClass source, int oid)
 {
     return(Task.Wait(() => source.Fetch(oid)));
 }
Example #15
0
 /// <summary>
 ///     Queries for the features that satisfies the attribute and/or spatial query as specified by an
 ///     <paramref name="filter" /> object and projects the results into a new form.
 /// </summary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="source">The source.</param>
 /// <param name="filter">The attribute and/or spatial requirement that the features must satisify.</param>
 /// <param name="selector">Projects each element of a sequence into a new form.</param>
 /// <returns>
 ///     Returns a <see cref="List{TResult}" /> representing the results of the query projected to the type.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">
 ///     filter
 ///     or
 ///     selector
 /// </exception>
 public static IList <TResult> FetchAsync <TResult>(this IFeatureClass source, IQueryFilter filter, Func <IFeature, TResult> selector)
 {
     return(Task.Wait(() => source.Fetch(filter, selector)));
 }
Example #16
0
 /// <summary>
 ///     Queries for the all features and executes the specified <paramref name="action" /> on each feature returned from
 ///     the query.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="action">The action to take for each feature in the cursor.</param>
 /// <returns>
 ///     Returns a <see cref="int" /> representing the number of features affected by the action.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">action</exception>
 /// <exception cref="ArgumentNullException">action</exception>
 /// <remarks>
 ///     Uses a recycling cursors rehydrate a single feature object on each fetch and can be used to optimize read-only
 ///     access
 /// </remarks>
 public static int FetchAsync(this IFeatureClass source, Func <IFeature, bool> action)
 {
     return(Task.Wait(() => source.Fetch(action)));
 }
Example #17
0
 /// <summary>
 ///     Queries for the features that satisfies the attribute and/or spatial query as specified by an
 ///     <paramref name="filter" /> object
 ///     and executes the specified <paramref name="action" /> on each feature returned from the query.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="filter">The attribute and/or spatial requirement that the features must satisify.</param>
 /// <param name="action">The action to take for each feature in the cursor.</param>
 /// <returns>
 ///     Returns a <see cref="int" /> representing the number of features affected by the action.
 /// </returns>
 /// <exception cref="System.ArgumentNullException">action</exception>
 /// <exception cref="ArgumentNullException">action</exception>
 public static int FetchAsync(this IFeatureClass source, IQueryFilter filter, Action <IFeature> action)
 {
     return(Task.Wait(() => source.Fetch(filter, action)));
 }