Esempio n. 1
0
        public IDictionary <string, object> GetTaskInput(IList <TaskParameter> dicParams)
        {
            if (dicParams == null)
            {
                return(new Dictionary <string, object>());
            }

            var context     = new ConsoleReadContext();
            var group       = new GroupTaskParameter(dicParams);
            var groupReader = _consoleTaskParameterFactory.GetInstance(group.Type);

            groupReader.Read(context, group);

            if (context.IsCanceled)
            {
                return(null);
            }

            /*
             * foreach (var param in dicParams)
             * {
             *  if (!param.Condition(context)) continue;
             *
             *  var reader = _consoleTaskParameterFactory.GetInstance(param.Type);
             *  reader.Read(context, param);
             *  if (context.IsCanceled) return null;
             * }
             */
            return(context.Values);
        }
Esempio n. 2
0
 public override void Read(ConsoleReadContext context, GroupTaskParameter param)
 {
     foreach (var p in param.Parameters)
     {
         var reader      = _taskParameterConsoleReaderFactory.GetInstance(p.Type);
         var isEvaluable = CheckEvaluable(p, context);
         if (isEvaluable)
         {
             reader.Read(context, p);
         }
         if (context.IsCanceled)
         {
             return;
         }
     }
 }