public TemplateCommand(JsonNode jsonNode, Template template) { m_jsonNode = jsonNode; m_template = template; m_type = jsonNode.GetObjectOrDefault("type", TemplateCommandType.Undefined); m_pathSeperator = jsonNode.GetObjectOrDefault<char?>("pathSeparator", null); }
public TemplateParameter(JsonNode jsonNode, Template template) { m_name = jsonNode.GetObjectOrDefault("name", "unknown"); m_type = jsonNode.GetObjectOrDefault("type", TemplateParameterType.Undefined); m_value = jsonNode.GetObjectOrDefault("default", ""); template.AddParameters(ref m_value, null, null); m_isEditable = !jsonNode.GetObjectOrDefault("isreadonly", false); m_description = jsonNode.GetObjectOrDefault<string>("description", null); m_key = jsonNode.GetObjectOrDefault<string>("key", null); string pathSeparator = jsonNode.GetObjectOrDefault("pathseparator", "\\"); m_pathSeparator = pathSeparator.Length > 0 ? pathSeparator[0] : '\\'; if (m_type == TemplateParameterType.File) { if (string.IsNullOrEmpty(m_value)) m_value = template.TargetPath; m_value = m_value.Replace('\\', m_pathSeparator); } }