コード例 #1
0
        /// <summary>
        /// The current recipe holder
        /// </summary>
        /// <returns>The collection that represents the query result</returns>
        public FeatureCollection ResultCollection()
        {
            // The result collection to build up
            FeatureCollection resultCollection = null;

            // Get client side queries happening from the client
            if (Query.Context == ServiceProviderDatumContext.User)
            {
                // For now do it via a client side request
                var predicateText = this.Predicate ?? string.Empty;
                var recipe        = new FeatureCollectionRecipeByCollectionDefinition(this.Query.TableDescriptor, this.Parameters.ParameterValues, predicateText)
                {
                    Description = this.ExternalName
                };

                resultCollection = new FeatureRecipeCollection(recipe);
            }
            else
            {
                // Server query
                resultCollection = this.Query.ToCollection(this.Parameters.ParameterValues);
            }

            // In case the user wants to further restrict these, ask the messenger for restricting
            resultCollection = RestrictedCollection(resultCollection);

            return(resultCollection);
        }
        /// <summary>
        /// Constructor for request for displaying a feature collection
        /// </summary>
        /// <param name="sender">The originator of the request</param>
        /// <param name="recipeHolder">The holder of the recipe for the feature collection</param>
        public LiteDisplayFeatureCollectionRequestMessage(Object sender, IFeatureCollectionRecipeHolder recipeHolder)
            : base(sender)
        {
            if (recipeHolder != null)
            {
                // Check whether this is a direct collection
                var collection = recipeHolder as FeatureCollection;
                if (collection == null)
                {
                    var recipe = recipeHolder.CollectionRecipe;
                    if (recipe != null)
                    {
                        collection = new FeatureRecipeCollection(recipe);
                    }
                }

                this.FeatureCollection = collection;
            }
        }