Beispiel #1
0
 /// <summary>
 /// Adds the given query (new format) to the list of queries to be
 /// evaluated.
 /// </summary>
 /// <param name="id">
 /// The unique id of the query
 /// </param>
 /// <param name="query">
 /// The query function to be evaluated
 /// </param>
 public void AddQuery(string id, Query query)
 {
     if (QueryMap.ContainsKey(id))
     {
         throw new Exception("A query with id '" + id + "' already exists");
     }
     QueryMap.Add(id, query);
 }
Beispiel #2
0
        public void ValueQuery(string name, double value, bool OverWriteIfExistent = false)
        {
            Query query = (app, t) => value;

            if (QueryMap.ContainsKey(name))
            {
                if (!OverWriteIfExistent)
                {
                    throw new Exception("A query with id '" + name + "' already exists");
                }
                else
                {
                    QueryMap[name] = query;
                }
            }
            else
            {
                QueryMap.Add(name, query);
            }
        }