Ejemplo n.º 1
0
 /// <summary>
 /// Lists all of the available Microsoft.Features REST API operations.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <Operation> > ListOperationsNextAsync(this IFeatureClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListOperationsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Interprets the object and reports the findings to the client.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="geo"></param>
        public void Interpret(IFeatureClient client, OsmGeo geo)
        {
            // call the onbefore function
            client.OnBeforeInterpretation(geo);

            // interpret the object.
            bool succes = _root_feature.Interpret(geo,client);

            // call the onafter function
            client.OnAfterInterpretation(succes,geo);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Lists all of the available Microsoft.Features REST API operations.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <Operation> ListOperationsNext(this IFeatureClient operations, string nextPageLink)
 {
     return(operations.ListOperationsNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Lists all of the available Microsoft.Features REST API operations.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <Operation> ListOperations(this IFeatureClient operations)
 {
     return(operations.ListOperationsAsync().GetAwaiter().GetResult());
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Interprets a feature and reports to the client if the feature matches the filter.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="client"></param>
        /// <returns></returns>
        public bool Interpret(
            OsmGeo obj,
            IFeatureClient client)
        {
            if (_filter.Evaluate(obj))
            {
                // add the meta tags.
                Dictionary<string,string> meta = new Dictionary<string,string>();

                foreach(string value in _meta.Keys)
                {
                    meta.Add(value,string.Empty);

                    // check all the tags in the list.
                    foreach(string tag in _meta[value])
                    {
                        if(obj.Tags.ContainsKey(value))
                        {
                            string tag_value = obj.Tags["tag"];

                            if(tag_value != null && tag_value.Length > 0)
                            {
                                meta[value] = tag_value;
                            }
                        }
                    }
                }

                // report the interpretation succes.
                client.InterpretationSucces(_path, obj, meta);

                return true;
            }
            return false;
        }