Esempio n. 1
0
 public void AddParameters(string name, IProjectParameters projectParameters)
 {
     Contract.Requires(!string.IsNullOrWhiteSpace(name));
     Contract.Requires(projectParameters != null);
     Contract.Requires(!HasParameters(name));
     Contract.Ensures(HasParameters(name));
 }
Esempio n. 2
0
        /// <summary>
        /// Adds a new parameter block to this model item
        /// </summary>
        /// <param name="paramsName">Name of the parameter block</param>
        /// <param name="projectParameters">The parameter block to be added</param>
        public void AddParameters(string paramsName, IProjectParameters projectParameters)
        {
            var inheritableProjectParameters = projectParameters as IInheritableProjectParameters;

            if (inheritableProjectParameters != null)
            {
                parameters.Add(paramsName, inheritableProjectParameters.WithParent(module.Suite, module.GetInheritableParameters(paramsName, inheritableProjectParameters.Definition)));
            }
            else
            {
                parameters.Add(paramsName, projectParameters);
            }
        }
Esempio n. 3
0
        private void SetProjectPostProcessors(Suite suite, IPostProcessorsHolder project, YamlNode postProcessorDefinitions)
        {
            Contract.Requires(suite != null);
            Contract.Requires(project != null);
            Contract.Requires(postProcessorDefinitions != null);

            foreach (var pair in parser.EnumerateNamedNodesOf(postProcessorDefinitions, "postprocessors"))
            {
                var name  = pair.Key;
                var value = pair.Value;

                PostProcessorId ppid;
                if (value == null)
                {
                    ppid = name;
                }
                else if (value is YamlMappingNode)
                {
                    ppid = parser.GetScalarValue(value, "type", "Post processor type is not specified");
                }
                else
                {
                    ppid = null;
                }

                if (ppid != null)
                {
                    var loader = parametersLoaders.FirstOrDefault(l => l.Supports(ppid.AsString));

                    IProjectParameters param = null;
                    if (loader != null)
                    {
                        param = loader.Load(suite, ppid.AsString, value, parser);
                    }

                    project.AddPostProcessor(new PostProcessDefinition(name, ppid)
                    {
                        Parameters = param
                    });
                }
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Adds a new parameter block to this model item
 /// </summary>
 /// <param name="paramsName">Name of the parameter block</param>
 /// <param name="projectParameters">The parameter block to be added</param>
 public void AddParameters(string paramsName, IProjectParameters projectParameters)
 {
     parameters.Add(paramsName, projectParameters);
 }
Esempio n. 5
0
 protected ProjectParametersDependencies(Project project, string name)
 {
     this.project = project;
     blockName    = name;
     parameters   = project.GetParameters <IProjectParameters>(name);
 }
 protected ProjectParametersDependencies(Project project, string name)
 {
     this.project = project;
     blockName = name;
     parameters = project.GetParameters<IProjectParameters>(name);
 }