Skip to content

Commit c8fb0ad

Browse files
DYN-7899: Type forward nodecategoryattribute for use in external node libs such as protogeometry (DynamoDS#16914)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent fc14f5f commit c8fb0ad

File tree

10 files changed

+471
-30
lines changed

10 files changed

+471
-30
lines changed

doc/distrib/xml/en-US/FFITarget.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DynamoCore/Graph/Nodes/Attributes.cs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,7 @@ public NodeNameAttribute(string elementName)
1919
}
2020

2121
/// <summary>
22-
/// The NodeCategoryAttribute attribute allows the node implementer
23-
/// to define in which category node will appear.
24-
/// </summary>
25-
[AttributeUsage(AttributeTargets.All)]
26-
public class NodeCategoryAttribute : Attribute
27-
{
28-
/// <summary>
29-
/// Creates NodeCategoryAttribute.
30-
/// </summary>
31-
/// <param name="category">Full name of the category. E.g. Core.List.Create</param>
32-
public NodeCategoryAttribute(string category)
33-
{
34-
ElementCategory = category;
35-
}
36-
37-
/// <summary>
38-
/// Full name of the category. E.g. Core.List.Create
39-
/// </summary>
40-
public string ElementCategory { get; set; }
41-
}
42-
43-
/// <summary>
44-
/// The NodeCategoryAttribute attribute allows the node implementer
22+
/// The NodeSearchTagsAttribute attribute allows the node implementer
4523
/// to define search tags.
4624
/// </summary>
4725
[AttributeUsage(AttributeTargets.All)]

src/DynamoCore/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
[assembly: InternalsVisibleTo("MCPServer")]
6565

6666
// Disable PublicAPIAnalyzer errors for this type as they're already added to the public API text file
67-
#pragma warning disable RS0016
67+
#pragma warning disable RS0016
6868
[assembly: TypeForwardedTo(typeof(Dynamo.Scheduler.Disposable))]
69+
// NodeCategoryAttribute moved to DynamoServices so libraries that reference only DynamoServices (e.g. LibG) can use it.
70+
[assembly: TypeForwardedTo(typeof(Dynamo.Graph.Nodes.NodeCategoryAttribute))]
6971
#pragma warning restore RS0016

src/DynamoCore/PublicAPI.Unshipped.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -928,10 +928,6 @@ Dynamo.Graph.Nodes.LacingStrategy.Disabled = 0 -> Dynamo.Graph.Nodes.LacingStrat
928928
Dynamo.Graph.Nodes.LacingStrategy.First = 1 -> Dynamo.Graph.Nodes.LacingStrategy
929929
Dynamo.Graph.Nodes.LacingStrategy.Longest = 3 -> Dynamo.Graph.Nodes.LacingStrategy
930930
Dynamo.Graph.Nodes.LacingStrategy.Shortest = 2 -> Dynamo.Graph.Nodes.LacingStrategy
931-
Dynamo.Graph.Nodes.NodeCategoryAttribute
932-
Dynamo.Graph.Nodes.NodeCategoryAttribute.ElementCategory.get -> string
933-
Dynamo.Graph.Nodes.NodeCategoryAttribute.ElementCategory.set -> void
934-
Dynamo.Graph.Nodes.NodeCategoryAttribute.NodeCategoryAttribute(string category) -> void
935931
Dynamo.Graph.Nodes.NodeDeprecatedAttribute
936932
Dynamo.Graph.Nodes.NodeDeprecatedAttribute.NodeDeprecatedAttribute() -> void
937933
Dynamo.Graph.Nodes.NodeDescriptionAttribute

src/NodeServices/DynamoServices.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<ImportGroup Label="PropertySheets">
33
<Import Project="$(SolutionDir)Config\CS_SDK.props" />
44
</ImportGroup>
@@ -19,9 +19,13 @@
1919
<TargetFrameworks>netstandard2.0;net8.0;net10.0</TargetFrameworks>
2020
</PropertyGroup>
2121
<PropertyGroup>
22-
<NoWarn>MSB3539;CS1591;NUnit2005;NUnit2007;CS0618;CS0612;CS0672</NoWarn>
22+
<NoWarn>MSB3539;CS1591;NUnit2005;NUnit2007;CS0618;CS0612;CS0672;RS0026</NoWarn>
2323
</PropertyGroup>
2424
<ItemGroup>
25+
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
26+
<PrivateAssets>all</PrivateAssets>
27+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28+
</PackageReference>
2529
<!--exclude these dependencies as Sys.Ref.MetadataLoadContext.dll is already pulled in from other projects and the transitive deps are part of the .net8/net10 runtime.-->
2630
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="8.0.0" ExcludeAssets="runtime" />
2731
</ItemGroup>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
3+
namespace Dynamo.Graph.Nodes
4+
{
5+
/// <summary>
6+
/// The NodeCategoryAttribute attribute allows the node implementer
7+
/// to define in which category node will appear.
8+
/// Moved from DynamoCore to DynamoServices so libraries that reference only DynamoServices
9+
/// (e.g. LibG) can use it to control Create/Actions/Query grouping for Zero Touch nodes.
10+
/// </summary>
11+
[AttributeUsage(AttributeTargets.All)]
12+
public class NodeCategoryAttribute : Attribute
13+
{
14+
/// <summary>
15+
/// Creates NodeCategoryAttribute.
16+
/// </summary>
17+
/// <param name="category">Full name of the category. E.g. Core.List.Create, or "Create", "Actions", "Query" for grouping.</param>
18+
public NodeCategoryAttribute(string category)
19+
{
20+
ElementCategory = category;
21+
}
22+
23+
/// <summary>
24+
/// Full name of the category. E.g. Core.List.Create
25+
/// </summary>
26+
public string ElementCategory { get; set; }
27+
}
28+
}

src/NodeServices/PublicAPI.Shipped.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)