Esempio n. 1
0
        static public bool IsApplicable(TaskInput taskInput, IEnumerable <KeyValuePair <string, object> > parameters)
        {
            if (taskInput.IsApplicable.GetAttributes() != null)
            {
                foreach (var kvp in taskInput.IsApplicable.GetAttributes().ToList())
                {
                    taskInput.IsApplicable.Remove(kvp.Key);
                }
            }

            foreach (var kvp in parameters)
            {
                taskInput.IsApplicable.Add(kvp.Key, kvp.Value);
            }

            string result = taskInput.IsApplicable.Render();

            return(string.Equals(result, "true", StringComparison.InvariantCultureIgnoreCase));
        }
Esempio n. 2
0
        static public PathAndContent Execute(TaskInput taskInput, IEnumerable <KeyValuePair <string, object> > parameters)
        {
            if (taskInput.OutputPath.GetAttributes() != null)
            {
                foreach (var kvp in taskInput.OutputPath.GetAttributes().ToList())
                {
                    taskInput.OutputPath.Remove(kvp.Key);
                    taskInput.Content.Remove(kvp.Key);
                }
            }

            foreach (var kvp in parameters)
            {
                taskInput.OutputPath.Add(kvp.Key, kvp.Value);
                taskInput.Content.Add(kvp.Key, kvp.Value);
            }

            return(new PathAndContent(new ItemInformation(taskInput.OutputPath.Render(), ""), taskInput.Content.Render()));
        }
Esempio n. 3
0
 public NamespaceTask(TaskInput taskInput, Namespace namespaceDescriptor)
 {
     TaskInput           = taskInput;
     NamespaceDescriptor = namespaceDescriptor;
 }
Esempio n. 4
0
 public TypeTask(TaskInput taskInput, TypeBase descriptor)
 {
     TaskInput  = taskInput;
     Descriptor = descriptor;
 }
Esempio n. 5
0
 public ModelTask(TaskInput taskInput, Model model)
 {
     TaskInput = taskInput;
     Model     = model;
 }