private string[] GetMethodParameters(TagHelperDescriptor tagHelper) { var viewComponentName = tagHelper.GetViewComponentName(); var methodParameters = new[] { $"\"{viewComponentName}\"", $"{TagHelperProcessInvokeAsyncArgsMethodName}({TagHelperContextVariableName})" }; return(methodParameters); }
private string[] GetMethodParameters(TagHelperDescriptor tagHelper) { var propertyNames = tagHelper.BoundAttributes.Select(attribute => attribute.GetPropertyName()); var joinedPropertyNames = string.Join(", ", propertyNames); var parametersString = $"new {{ { joinedPropertyNames } }}"; var viewComponentName = tagHelper.GetViewComponentName(); var methodParameters = new[] { $"\"{viewComponentName}\"", parametersString }; return(methodParameters); }
public bool Add(TagHelperDescriptor tagHelper) { if (_tagHelpers.ContainsKey(tagHelper)) { return(false); } var className = $"__Generated__{tagHelper.GetViewComponentName()}ViewComponentTagHelper"; var fullyQualifiedName = $"{Namespace.Content}.{Class.ClassName}.{className}"; var fieldName = GenerateFieldName(tagHelper); _tagHelpers.Add(tagHelper, (className, fullyQualifiedName, fieldName)); return(true); }
private static string GenerateFieldName(TagHelperDescriptor tagHelper) { return($"__{tagHelper.GetViewComponentName()}ViewComponentTagHelper"); }