Exemplo n.º 1
0
 /// <summary>
 /// Scans an assembly for e.g. <see cref="CQLGlobalFunction"/> to extend the scope with global functions and variables.
 /// </summary>
 /// <param name="this"></param>
 /// <param name="assembly"></param>
 public static void AddFromScan(this IEvaluationScope @this, Assembly assembly)
 {
     foreach (var type in assembly.GetTypes())
     {
         @this.AddTypeScan(type);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Scans a type and its nested types for e.g. <see cref="CQLGlobalFunction"/> to extend the scope with global functions and variables.
        /// </summary>
        /// <param name="this"></param>
        /// <param name="type"></param>
        public static void AddFromScan(this IEvaluationScope @this, Type type)
        {
            var types = new[] { type }.Concat(type.GetNestedTypes());

            foreach (var tpe in types)
            {
                @this.AddTypeScan(tpe);
            }
        }