Files
InterfaceGenerator/Speckle.InterfaceGenerator/AttributeDataExtensions.cs
T
2024-05-17 11:58:54 +01:00

14 lines
382 B
C#

using System.Linq;
using Microsoft.CodeAnalysis;
namespace Speckle.InterfaceGenerator;
internal static class AttributeDataExtensions
{
public static string? GetNamedParamValue(this AttributeData attributeData, string paramName)
{
var pair = attributeData.NamedArguments.FirstOrDefault(x => x.Key == paramName);
return pair.Value.Value?.ToString();
}
}