Beispiel #1
0
 public static Strainer Create(Context context)
 {
     Strainer strainer = new Strainer(context);
     foreach (var keyValue in Filters)
         strainer.Extend(keyValue.Value);
     return strainer;
 }
Beispiel #2
0
        public static Strainer Create(Context context)
        {
            Strainer strainer = new Strainer(context);

            foreach (var keyValue in Filters)
            {
                strainer.Extend(keyValue.Value);
            }
            return(strainer);
        }
        public static Strainer Create(Context context)
        {
            var strainer = new Strainer(context);

            foreach (KeyValuePair <string, Type> keyValue in Filters)
            {
                strainer.Extend(keyValue.Value);
            }

            foreach (KeyValuePair <string, Tuple <object, MethodInfo> > keyValue in FilterFuncs)
            {
                strainer.AddMethodInfo(keyValue.Key, keyValue.Value.Item1, keyValue.Value.Item2);
            }

            return(strainer);
        }
Beispiel #4
0
        public static Strainer Create(Context context)
        {
            Strainer strainer = new Strainer(context);

            foreach (var keyValue in Filters)
            {
                strainer.Extend(keyValue.Value);
            }

            foreach (var keyValue in FilterFuncs)
            {
                strainer.AddMethodInfo(keyValue.Key, keyValue.Value.Item1, keyValue.Value.Item2);
            }

            return(strainer);
        }
Beispiel #5
0
 /// <summary>
 /// Pass a module with filter methods which should be available
 ///  to all liquid views. Good for registering the standard library
 /// </summary>
 /// <param name="filter"></param>
 public static void RegisterFilter(Type filter)
 {
     Strainer.GlobalFilter(filter);
 }