void AddNewArtifact(Artifacts.Artifact artifactObject, Type artifact, IDictionary <ArtifactId, ArtifactDefinition> mutableArtifacts, string artifactTypeName)
        {
            var artifactDefinition = new ArtifactDefinition(artifactObject.Generation, ClrType.FromType(artifact));

            _logger.Trace($"Adding '{artifact.Name}' as a new {artifactTypeName} artifact with identifier '{artifactObject.Id}'");
            mutableArtifacts[artifactObject.Id] = artifactDefinition;
        }
Beispiel #2
0
        Proxy GenerateCommandProxy(Type artifact, ArtifactsConfiguration artifactsConfig, ArgumentsParsingResult parsingResults, Func <object, string> template)
        {
            _logger.Trace($"Creating command proxy for {ClrType.FromType(artifact).TypeString}");

            var artifactId        = GetArtifactId(artifact, artifactsConfig);
            var handlebarsCommand = new HandlebarsCommand()
            {
                CommandName = artifact.Name,
                ArtifactId  = artifactId.Value.ToString()
            };
            var setableProperties = artifact.GetSettableProperties();

            if (setableProperties.Any())
            {
                handlebarsCommand.Properties = CreateProxyProperties(setableProperties);
            }

            return(CreateProxy(artifact, template(handlebarsCommand), parsingResults));
        }