From 91e147041ca8c7cd2b7a548f1954ae54829bc497 Mon Sep 17 00:00:00 2001 From: aparajit-pratap Date: Mon, 23 Nov 2020 13:48:57 -0500 Subject: [PATCH 01/27] update samples, fix build (#35) --- src/SampleExtension/SampleExtension.csproj | 1 - .../Examples/BasicExample.cs | 33 +++++++++++++++++-- .../SampleLibraryZeroTouch.csproj | 4 +-- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index 41896bb..3a8418b 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -139,7 +139,6 @@ - diff --git a/src/SampleLibraryZeroTouch/Examples/BasicExample.cs b/src/SampleLibraryZeroTouch/Examples/BasicExample.cs index 54364cb..6c1a13b 100644 --- a/src/SampleLibraryZeroTouch/Examples/BasicExample.cs +++ b/src/SampleLibraryZeroTouch/Examples/BasicExample.cs @@ -126,9 +126,12 @@ public static BasicExample Create(double x=42.0, double y=42.0, double z=42.0) /// /// The MultiReturn attribute can be used to specify - /// the names of multiple output ports on a node that - /// returns a dictionary. The node must return a dictionary - /// to be recognized as a multi-out node. + /// that a node is a multi-out node. This node must return + /// a Dictionary with its keys matching the attributes specified in the + /// MultiReturn attribute. The names of the output ports + /// match the attribute names if there are no XML returns tags. + /// The returned dictionary displayed in the node preview is displayed + /// in the order of its keys as specified in the MultiReturn attribute. /// /// [MultiReturn(new[] { "thing 1", "thing 2" })] @@ -141,6 +144,30 @@ public static Dictionary> MultiReturnExample() }; } + /// + /// The MultiReturn attribute can be used to specify + /// that a node is a multi-out node. This node must return + /// a Dictionary with its keys matching the attributes specified in the + /// MultiReturn attribute. The names of the output ports + /// match the XML returns tag only if they include descriptions. + /// Otherwise the output ports will match the attribute names. + /// The returned dictionary displayed in the node preview is displayed + /// in the order of its keys as specified in the MultiReturn attribute. + /// E.g. this node will display "thing1" and "thing2" in its output ports + /// but it will show "thing 1" and "thing 2" in the node preview. + /// + /// thing one + /// thing two + [MultiReturn(new[] { "thing 1", "thing 2" })] + public static Dictionary> MultiReturnExample2() + { + return new Dictionary>() + { + { "thing 1", new List{"apple", "banana", "cat"} }, + { "thing 2", new List{"Tywin", "Cersei", "Hodor"} } + }; + } + /// /// OPTIONAL: /// Overriding ToString allows you to control what is diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index 08b15a2..085328b 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -24,7 +24,7 @@ DEBUG;TRACE prompt 4 - bin\Debug\$(UICulture)\SampleLibraryZeroTouch.XML + bin\Debug\SampleLibraryZeroTouch.XML false @@ -34,7 +34,7 @@ TRACE prompt 4 - bin\Release\$(UICulture)\SampleLibraryZeroTouch.XML + bin\Release\SampleLibraryZeroTouch.XML false From c397c39b04b075a716af15eb3111f992a0ba6266 Mon Sep 17 00:00:00 2001 From: aparajit-pratap Date: Thu, 3 Dec 2020 15:12:15 -0500 Subject: [PATCH 02/27] edit multireturn node example --- src/SampleLibraryZeroTouch/Examples/BasicExample.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SampleLibraryZeroTouch/Examples/BasicExample.cs b/src/SampleLibraryZeroTouch/Examples/BasicExample.cs index 6c1a13b..5229eb5 100644 --- a/src/SampleLibraryZeroTouch/Examples/BasicExample.cs +++ b/src/SampleLibraryZeroTouch/Examples/BasicExample.cs @@ -153,11 +153,11 @@ public static Dictionary> MultiReturnExample() /// Otherwise the output ports will match the attribute names. /// The returned dictionary displayed in the node preview is displayed /// in the order of its keys as specified in the MultiReturn attribute. - /// E.g. this node will display "thing1" and "thing2" in its output ports + /// E.g. this node will display "thing one" and "thing two" in its output ports /// but it will show "thing 1" and "thing 2" in the node preview. /// - /// thing one - /// thing two + /// first thing + /// second thing [MultiReturn(new[] { "thing 1", "thing 2" })] public static Dictionary> MultiReturnExample2() { From 058777fa98d91c7ecd39db09895858f8cb8081f1 Mon Sep 17 00:00:00 2001 From: Martin Misol Monzo Date: Fri, 11 Dec 2020 16:55:56 -0500 Subject: [PATCH 03/27] Update SampleViewExtension with new features (#36) The SampleViewExtension is updated to use the extension sidebar API and also implement the Closed method to update the status of its menu item. --- README.md | 13 ++- ...namoSamples.2013.sln => DynamoSamples.sln} | 0 src/SampleExtension/SampleExtension.csproj | 69 ++++++------- src/SampleExtension/packages.config | 10 +- .../SampleLibraryTests.csproj | 97 ++++++++++--------- src/SampleLibraryTests/app.config | 16 +-- src/SampleLibraryTests/packages.config | 15 ++- src/SampleLibraryUI/SampleLibraryUI.csproj | 87 ++++++++++------- src/SampleLibraryUI/app.config | 20 ++-- src/SampleLibraryUI/packages.config | 15 ++- .../SampleLibraryZeroTouch.csproj | 74 ++++++++------ src/SampleLibraryZeroTouch/app.config | 11 --- src/SampleLibraryZeroTouch/packages.config | 13 ++- .../SampleViewExtension.cs | 61 ++++++------ .../SampleViewExtension.csproj | 83 ++++++++++------ src/SampleViewExtension/packages.config | 15 ++- src/build.xml | 2 +- 17 files changed, 343 insertions(+), 258 deletions(-) rename src/{DynamoSamples.2013.sln => DynamoSamples.sln} (100%) delete mode 100644 src/SampleLibraryZeroTouch/app.config diff --git a/README.md b/README.md index ec8a1d4..716f7e8 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,21 @@ These samples make use of the [Dynamo NuGet packages](https://www.nuget.org/pack # Building the Samples +## Requirements +- Visual Studio 2019 +- .NET Framework 4.8 + +## Instructions - Clone the repository. - Choose a branch: - The master branch of Dynamo Samples corresponds to the master branch of Dynamo. To build against a specific version, choose that version's branch. I.e. 0.8.0, 0.9.0, etc. -- In VisualStudio 2013 or greater, open DynamoSamples.2013.sln. -- Build the Debug/Any CPU configuration. -- The `dynamo_package` folder at the root of the repository will now have the built libraries. The `Dynamo Samples` folder in that directory can be copied directly to your Dynamo packages directory:`C:\Users\\AppData\Roaming\Dynamo\0.8\packages`. +- Open `DynamoSamples.sln` with Visual Studio. +- Build using the `Debug/Any CPU` configuration. +- The `dynamo_package` folder at the root of the repository will now have the built libraries. The `Dynamo Samples` folder in that directory can be copied directly to your Dynamo packages directory:`C:\Users\\AppData\Roaming\Dynamo Core\\packages`. - To install the sample view extension the `SampleViewExtension\bin\debug` folder (or release) should contain - `SampleViewExtension.dll` which should be copied to your root Dynamo build location - `SampleViewExtension_ViewExtensionDefinition` which should be copied to the `viewExtensions` folder inside your root Dynamo build location -- Run Dynamo. You should find `SampleLibraryUI` and `SampleLibraryZeroTouch` categories in your library and the `view` tab inside of Dynamo should now contain `Show View Extension Sample Window`. +- Run Dynamo. You should find `SampleLibraryUI` and `SampleLibraryZeroTouch` categories in your library and the `View` tab inside of Dynamo should now contain `Show View Extension Sample Window`. Assembly Reference Path to assembly for binaries are defined in CS.props and user_local.props which can be found at $(SolutionDirectory)\Config diff --git a/src/DynamoSamples.2013.sln b/src/DynamoSamples.sln similarity index 100% rename from src/DynamoSamples.2013.sln rename to src/DynamoSamples.sln diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index 3a8418b..927ac3b 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -33,41 +33,44 @@ false - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.7.0.9206\lib\net48\CoreNodeModels.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModels.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.7.0.9206\lib\net48\CoreNodeModelsWpf.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModelsWpf.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.7.0.9206\lib\net48\DynamoCoreWpf.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\DynamoCoreWpf.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.7.0.9206\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -81,9 +84,8 @@ ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll False - - ..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll - False + + ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll @@ -95,11 +97,11 @@ - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\ProtoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll @@ -129,8 +131,8 @@ - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\VMDataBridge.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll @@ -142,7 +144,6 @@ - diff --git a/src/SampleExtension/packages.config b/src/SampleExtension/packages.config index e870127..d6cf4a1 100644 --- a/src/SampleExtension/packages.config +++ b/src/SampleExtension/packages.config @@ -1,10 +1,10 @@  - - - - - + + + + + diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index 51ef13b..045c47e 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -36,43 +36,38 @@ false - - False - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll - - False - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll - - False - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll - - False - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll - - False - ..\packages\DynamoVisualProgramming.Tests.2.7.0.9206\lib\net48\DynamoCoreTests.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll - - False - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.Tests.2.10.0.3455\lib\net48\DynamoCoreTests.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.7.0.9206\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll - - False - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll - - False - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -87,9 +82,8 @@ ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll False - + ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - False ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll @@ -102,31 +96,43 @@ - - False - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\ProtoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll + + + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll False - - False - ..\packages\DynamoVisualProgramming.Tests.2.7.0.9206\lib\net48\SystemTestServices.dll + + ..\packages\DynamoVisualProgramming.Tests.2.10.0.3455\lib\net48\SystemTestServices.dll - - False - ..\packages\DynamoVisualProgramming.Tests.2.7.0.9206\lib\net48\TestServices.dll + + ..\packages\DynamoVisualProgramming.Tests.2.10.0.3455\lib\net48\TestServices.dll - - False - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\VMDataBridge.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll @@ -148,9 +154,6 @@ PreserveNewest - - - diff --git a/src/SampleLibraryTests/app.config b/src/SampleLibraryTests/app.config index 8776eff..409ee74 100644 --- a/src/SampleLibraryTests/app.config +++ b/src/SampleLibraryTests/app.config @@ -1,15 +1,19 @@ - + - - + + - - + + + + + + - + diff --git a/src/SampleLibraryTests/packages.config b/src/SampleLibraryTests/packages.config index 4c65ffd..b242f35 100644 --- a/src/SampleLibraryTests/packages.config +++ b/src/SampleLibraryTests/packages.config @@ -1,11 +1,16 @@  - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/src/SampleLibraryUI/SampleLibraryUI.csproj b/src/SampleLibraryUI/SampleLibraryUI.csproj index f2f8f8f..a480468 100644 --- a/src/SampleLibraryUI/SampleLibraryUI.csproj +++ b/src/SampleLibraryUI/SampleLibraryUI.csproj @@ -41,41 +41,44 @@ false - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.7.0.9206\lib\net48\CoreNodeModels.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModels.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.7.0.9206\lib\net48\CoreNodeModelsWpf.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModelsWpf.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.7.0.9206\lib\net48\DynamoCoreWpf.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\DynamoCoreWpf.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.7.0.9206\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -89,9 +92,8 @@ ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll False - - ..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll - False + + ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll @@ -103,21 +105,37 @@ - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\ProtoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll + + + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll False - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\VMDataBridge.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll @@ -177,9 +195,6 @@ False - - - diff --git a/src/SampleLibraryUI/app.config b/src/SampleLibraryUI/app.config index 953e4ac..2f9b0f0 100644 --- a/src/SampleLibraryUI/app.config +++ b/src/SampleLibraryUI/app.config @@ -1,19 +1,23 @@ - + - - + + - - + + - - + + + + + + - + diff --git a/src/SampleLibraryUI/packages.config b/src/SampleLibraryUI/packages.config index 4a0f0bc..d6cf4a1 100644 --- a/src/SampleLibraryUI/packages.config +++ b/src/SampleLibraryUI/packages.config @@ -1,11 +1,16 @@  - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index 085328b..0baff16 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -38,32 +38,35 @@ false - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.7.0.9206\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -78,9 +81,8 @@ ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll False - - ..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll - False + + ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll @@ -94,19 +96,38 @@ False - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll + + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll + + + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll True False - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\VMDataBridge.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll @@ -125,9 +146,6 @@ - - - diff --git a/src/SampleLibraryZeroTouch/app.config b/src/SampleLibraryZeroTouch/app.config deleted file mode 100644 index a051a21..0000000 --- a/src/SampleLibraryZeroTouch/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/SampleLibraryZeroTouch/packages.config b/src/SampleLibraryZeroTouch/packages.config index 12ba288..a089e37 100644 --- a/src/SampleLibraryZeroTouch/packages.config +++ b/src/SampleLibraryZeroTouch/packages.config @@ -1,10 +1,15 @@  - - - - + + + + + + + + + \ No newline at end of file diff --git a/src/SampleViewExtension/SampleViewExtension.cs b/src/SampleViewExtension/SampleViewExtension.cs index e1b5b16..525de02 100644 --- a/src/SampleViewExtension/SampleViewExtension.cs +++ b/src/SampleViewExtension/SampleViewExtension.cs @@ -9,69 +9,72 @@ namespace SampleViewExtension /// The View Extension framework for Dynamo allows you to extend /// the Dynamo UI by registering custom MenuItems. A ViewExtension has /// two components, an assembly containing a class that implements - /// IViewExtension, and an ViewExtensionDefintion xml file used to - /// instruct Dynamo where to find the class containing the - /// IViewExtension implementation. The ViewExtensionDefinition xml file must + /// IViewExtension or extends ViewExtensionBase, and a ViewExtensionDefinition + /// XML file used to instruct Dynamo where to find the class containing the + /// View Extension implementation. The ViewExtensionDefinition XML file must /// be located in your [dynamo]\viewExtensions folder. /// - /// This sample demonstrates an IViewExtension implementation which - /// shows a modeless window when its MenuItem is clicked. + /// This sample demonstrates a View Extension implementation which inherits from + /// ViewExtensionBase. It adds a user interface to Dynamo's extension sidebar + /// when its MenuItem is clicked. /// The Window created tracks the number of nodes in the current workspace, /// by handling the workspace's NodeAdded and NodeRemoved events. /// - public class SampleViewExtension : IViewExtension + public class SampleViewExtension : ViewExtensionBase { private MenuItem sampleMenuItem; - public void Dispose() + public override void Dispose() { } - public void Startup(ViewStartupParams p) + public override void Startup(ViewStartupParams p) { } - public void Loaded(ViewLoadedParams p) + public override void Loaded(ViewLoadedParams p) { // Save a reference to your loaded parameters. // You'll need these later when you want to use // the supplied workspaces - sampleMenuItem = new MenuItem {Header = "Show View Extension Sample Window"}; - sampleMenuItem.Click += (sender, args) => + var viewModel = new SampleWindowViewModel(p); + var window = new SampleWindow { - var viewModel = new SampleWindowViewModel(p); - var window = new SampleWindow - { - // Set the data context for the main grid in the window. - MainGrid = { DataContext = viewModel }, + // Set the data context for the main grid in the window. + MainGrid = { DataContext = viewModel }, - // Set the owner of the window to the Dynamo window. - Owner = p.DynamoWindow - }; - - window.Left = window.Owner.Left + 400; - window.Top = window.Owner.Top + 200; - - // Show a modeless window. - window.Show(); + // Set the owner of the window to the Dynamo window. + Owner = p.DynamoWindow }; + + sampleMenuItem = new MenuItem { Header = "Show View Extension Sample Window", IsCheckable = true }; + sampleMenuItem.Checked += (sender, args) => p.AddToExtensionsSideBar(this, window); + sampleMenuItem.Unchecked += (sender, args) => p.CloseExtensioninInSideBar(this); p.AddMenuItem(MenuBarType.View, sampleMenuItem); } - public void Shutdown() + public override void Shutdown() + { + } + + public override void Closed() { + if (sampleMenuItem != null) + { + sampleMenuItem.IsChecked = false; + } } - public string UniqueId + public override string UniqueId { get { - return Guid.NewGuid().ToString(); + return "61BB15A8-9B6B-4AB0-8D75-F7C34E0B9112"; } } - public string Name + public override string Name { get { diff --git a/src/SampleViewExtension/SampleViewExtension.csproj b/src/SampleViewExtension/SampleViewExtension.csproj index af6756d..afdad95 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -34,41 +34,44 @@ 4 - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.7.0.9206\lib\net48\CoreNodeModels.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModels.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.7.0.9206\lib\net48\CoreNodeModelsWpf.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModelsWpf.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.7.0.9206\lib\net48\DynamoCoreWpf.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\DynamoCoreWpf.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.7.0.9206\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll - - ..\packages\DynamoVisualProgramming.Core.2.7.0.9206\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -83,9 +86,8 @@ ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll False - - ..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll - False + + ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll @@ -98,11 +100,30 @@ - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.7.0.9206\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll + + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll + + + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll True @@ -115,6 +136,9 @@ + + ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll + @@ -132,7 +156,6 @@ - Always diff --git a/src/SampleViewExtension/packages.config b/src/SampleViewExtension/packages.config index 4a0f0bc..d6cf4a1 100644 --- a/src/SampleViewExtension/packages.config +++ b/src/SampleViewExtension/packages.config @@ -1,11 +1,16 @@  - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/src/build.xml b/src/build.xml index a010ecc..cfead66 100644 --- a/src/build.xml +++ b/src/build.xml @@ -4,7 +4,7 @@ DefaultTargets="Build"> - DynamoSamples.2013.sln + DynamoSamples.sln From da4333aa9e280952012121d804b5e906b5fb8bd4 Mon Sep 17 00:00:00 2001 From: Michael Kirschner Date: Fri, 8 Jan 2021 13:33:35 -0500 Subject: [PATCH 04/27] Update Extension.cs (#37) --- src/SampleExtension/Extension.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SampleExtension/Extension.cs b/src/SampleExtension/Extension.cs index 376f665..04bbc7a 100644 --- a/src/SampleExtension/Extension.cs +++ b/src/SampleExtension/Extension.cs @@ -35,7 +35,7 @@ public string UniqueId { get { - return Guid.NewGuid().ToString(); + "49fee64a-4505-4f03-a6b6-0667a793f19a" } } From 0764014907c290b2d5b30d4f751f236060893ccd Mon Sep 17 00:00:00 2001 From: Michael Kirschner Date: Fri, 23 Apr 2021 16:08:03 -0400 Subject: [PATCH 05/27] Add localized customNodeModel sample (#38) * fix build * update appveyor build add new sample node add new spanish resx add new copy steps for localized content --- appveyor.yml | 4 +- src/SampleExtension/Extension.cs | 2 +- .../Examples/LocalizedCustomNodeModel.cs | 39 ++++++ .../Properties/Resources.Designer.cs | 9 ++ .../Properties/Resources.en-US.resx | 3 + .../Properties/Resources.es-ES.resx | 126 ++++++++++++++++++ src/SampleLibraryUI/Properties/Resources.resx | 3 + src/SampleLibraryUI/SampleLibraryUI.csproj | 8 +- 8 files changed, 189 insertions(+), 5 deletions(-) create mode 100644 src/SampleLibraryUI/Examples/LocalizedCustomNodeModel.cs create mode 100644 src/SampleLibraryUI/Properties/Resources.es-ES.resx diff --git a/appveyor.yml b/appveyor.yml index 24cdc98..d8928f9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,10 +5,10 @@ platform: Any CPU configuration: Release build: - project: src/DynamoSamples.2013.sln + project: src/DynamoSamples.sln verbosity: normal test: off before_build: - - nuget restore .\src\DynamoSamples.2013.sln \ No newline at end of file + - nuget restore .\src\DynamoSamples.sln \ No newline at end of file diff --git a/src/SampleExtension/Extension.cs b/src/SampleExtension/Extension.cs index 04bbc7a..167a3fa 100644 --- a/src/SampleExtension/Extension.cs +++ b/src/SampleExtension/Extension.cs @@ -35,7 +35,7 @@ public string UniqueId { get { - "49fee64a-4505-4f03-a6b6-0667a793f19a" + return "49fee64a-4505-4f03-a6b6-0667a793f19a"; } } diff --git a/src/SampleLibraryUI/Examples/LocalizedCustomNodeModel.cs b/src/SampleLibraryUI/Examples/LocalizedCustomNodeModel.cs new file mode 100644 index 0000000..1884763 --- /dev/null +++ b/src/SampleLibraryUI/Examples/LocalizedCustomNodeModel.cs @@ -0,0 +1,39 @@ +using Dynamo.Graph.Nodes; +using Newtonsoft.Json; +using ProtoCore.AST.AssociativeAST; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SampleLibraryUI.Examples +{ + /// + /// This example node uses .net .resx files and generated sattelite assemblies to perform runtime lookup of localized content + /// depending on the culture of the system Dynamo is running on. + /// Read more: https://docs.microsoft.com/en-us/dotnet/framework/resources/creating-resource-files-for-desktop-apps + /// You can use the -l "es-ES" flag when starting DynamoSandbox.exe to replace the English strings with Spanish ones. + /// + [NodeName("LocalizedNode")] + [NodeDescription("CustomNodeModelDescription", typeof(Properties.Resources))] + [OutPortNames("string")] + [OutPortTypes("string")] + [IsDesignScriptCompatible] + public class LocalizedCustomNodeModel : NodeModel + { + public LocalizedCustomNodeModel() + { + RegisterAllPorts(); + } + + [JsonConstructor] + public LocalizedCustomNodeModel(IEnumerable inPorts, IEnumerable outPorts) : base(inPorts, outPorts) { } + + public override IEnumerable BuildOutputAst(List inputAstNodes) + { + //return a localized string, that is defined in the resx file/resource assembly. + return new List { AstFactory.BuildAssignment(this.AstIdentifierForPreview, AstFactory.BuildPrimitiveNodeFromObject(Properties.Resources.LocalStringResult)) }; + } + } +} diff --git a/src/SampleLibraryUI/Properties/Resources.Designer.cs b/src/SampleLibraryUI/Properties/Resources.Designer.cs index 8d4c3f7..71c1820 100644 --- a/src/SampleLibraryUI/Properties/Resources.Designer.cs +++ b/src/SampleLibraryUI/Properties/Resources.Designer.cs @@ -86,5 +86,14 @@ internal static string CustomNodeModelPortDataOutputToolTip { return ResourceManager.GetString("CustomNodeModelPortDataOutputToolTip", resourceCulture); } } + + /// + /// Looks up a localized string similar to I am a localized string.. + /// + internal static string LocalStringResult { + get { + return ResourceManager.GetString("LocalStringResult", resourceCulture); + } + } } } diff --git a/src/SampleLibraryUI/Properties/Resources.en-US.resx b/src/SampleLibraryUI/Properties/Resources.en-US.resx index 8a1ae88..19f8875 100644 --- a/src/SampleLibraryUI/Properties/Resources.en-US.resx +++ b/src/SampleLibraryUI/Properties/Resources.en-US.resx @@ -127,4 +127,7 @@ A result. + + I am a localized string. + \ No newline at end of file diff --git a/src/SampleLibraryUI/Properties/Resources.es-ES.resx b/src/SampleLibraryUI/Properties/Resources.es-ES.resx new file mode 100644 index 0000000..4881840 --- /dev/null +++ b/src/SampleLibraryUI/Properties/Resources.es-ES.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Un nodo de interfaz de usuario de muestra que muestra una interfaz de usuario personalizada. + + + Soy una cadena localizada. + + \ No newline at end of file diff --git a/src/SampleLibraryUI/Properties/Resources.resx b/src/SampleLibraryUI/Properties/Resources.resx index 7abb752..fcea6be 100644 --- a/src/SampleLibraryUI/Properties/Resources.resx +++ b/src/SampleLibraryUI/Properties/Resources.resx @@ -127,4 +127,7 @@ A result. + + I am a localized string. + \ No newline at end of file diff --git a/src/SampleLibraryUI/SampleLibraryUI.csproj b/src/SampleLibraryUI/SampleLibraryUI.csproj index a480468..0a3919b 100644 --- a/src/SampleLibraryUI/SampleLibraryUI.csproj +++ b/src/SampleLibraryUI/SampleLibraryUI.csproj @@ -151,6 +151,7 @@ + @@ -175,6 +176,7 @@ + ResXFileCodeGenerator Resources.Designer.cs @@ -209,9 +211,11 @@ - + + - + + \ No newline at end of file From e24a539caec42bf1568117029432d3127d2310bb Mon Sep 17 00:00:00 2001 From: Michael Kirschner Date: Fri, 23 Apr 2021 19:42:43 -0400 Subject: [PATCH 06/27] missing comments (#39) * fix build * update appveyor build add new sample node add new spanish resx add new copy steps for localized content * comments --- src/SampleLibraryUI/Examples/LocalizedCustomNodeModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SampleLibraryUI/Examples/LocalizedCustomNodeModel.cs b/src/SampleLibraryUI/Examples/LocalizedCustomNodeModel.cs index 1884763..ddbeb50 100644 --- a/src/SampleLibraryUI/Examples/LocalizedCustomNodeModel.cs +++ b/src/SampleLibraryUI/Examples/LocalizedCustomNodeModel.cs @@ -10,10 +10,11 @@ namespace SampleLibraryUI.Examples { /// - /// This example node uses .net .resx files and generated sattelite assemblies to perform runtime lookup of localized content + /// This example node uses .net .resx files and generated satellite assemblies to perform runtime lookup of localized content /// depending on the culture of the system Dynamo is running on. /// Read more: https://docs.microsoft.com/en-us/dotnet/framework/resources/creating-resource-files-for-desktop-apps /// You can use the -l "es-ES" flag when starting DynamoSandbox.exe to replace the English strings with Spanish ones. + /// For more info on the CLI interface read more: https://github.com/DynamoDS/Dynamo/wiki/Dynamo-Command-Line-Interface /// [NodeName("LocalizedNode")] [NodeDescription("CustomNodeModelDescription", typeof(Properties.Resources))] From cf627daa90cf887f2ea9178091821e5cda184e30 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" <173288704@qq.com> Date: Mon, 10 May 2021 23:54:22 -0700 Subject: [PATCH 07/27] Update API Reference (#40) --- src/SampleExtension/SampleExtension.csproj | 66 +++++++++--------- src/SampleExtension/packages.config | 8 +-- .../SampleLibraryTests.csproj | 67 ++++++++++--------- src/SampleLibraryTests/packages.config | 8 +-- src/SampleLibraryUI/SampleLibraryUI.csproj | 67 ++++++++++--------- src/SampleLibraryUI/packages.config | 8 +-- .../SampleLibraryZeroTouch.csproj | 56 +++++++++------- src/SampleLibraryZeroTouch/packages.config | 6 +- .../SampleViewExtension.cs | 2 +- .../SampleViewExtension.csproj | 65 +++++++++--------- src/SampleViewExtension/packages.config | 8 +-- 11 files changed, 187 insertions(+), 174 deletions(-) diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index 927ac3b..8c37193 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -33,44 +33,44 @@ false - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModels.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModels.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModelsWpf.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModelsWpf.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\DynamoCoreWpf.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\DynamoCoreWpf.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -97,11 +97,11 @@ - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll @@ -131,8 +131,8 @@ - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll @@ -141,9 +141,11 @@ + + diff --git a/src/SampleExtension/packages.config b/src/SampleExtension/packages.config index d6cf4a1..2f6bbf9 100644 --- a/src/SampleExtension/packages.config +++ b/src/SampleExtension/packages.config @@ -1,10 +1,10 @@  - - - - + + + + diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index 045c47e..61f23e2 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -36,38 +36,38 @@ false - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - ..\packages\DynamoVisualProgramming.Tests.2.10.0.3455\lib\net48\DynamoCoreTests.dll + + ..\packages\DynamoVisualProgramming.Tests.2.12.0-beta4933\lib\net48\DynamoCoreTests.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -96,11 +96,11 @@ - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll @@ -125,14 +125,14 @@ False - - ..\packages\DynamoVisualProgramming.Tests.2.10.0.3455\lib\net48\SystemTestServices.dll + + ..\packages\DynamoVisualProgramming.Tests.2.12.0-beta4933\lib\net48\SystemTestServices.dll - - ..\packages\DynamoVisualProgramming.Tests.2.10.0.3455\lib\net48\TestServices.dll + + ..\packages\DynamoVisualProgramming.Tests.2.12.0-beta4933\lib\net48\TestServices.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll @@ -154,6 +154,9 @@ PreserveNewest + + + diff --git a/src/SampleLibraryTests/packages.config b/src/SampleLibraryTests/packages.config index b242f35..08c675f 100644 --- a/src/SampleLibraryTests/packages.config +++ b/src/SampleLibraryTests/packages.config @@ -1,10 +1,10 @@  - - - - + + + + diff --git a/src/SampleLibraryUI/SampleLibraryUI.csproj b/src/SampleLibraryUI/SampleLibraryUI.csproj index 0a3919b..9885da3 100644 --- a/src/SampleLibraryUI/SampleLibraryUI.csproj +++ b/src/SampleLibraryUI/SampleLibraryUI.csproj @@ -41,44 +41,44 @@ false - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModels.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModels.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModelsWpf.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModelsWpf.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\DynamoCoreWpf.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\DynamoCoreWpf.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -105,11 +105,11 @@ - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll @@ -134,8 +134,8 @@ False - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll @@ -197,6 +197,9 @@ False + + + diff --git a/src/SampleLibraryUI/packages.config b/src/SampleLibraryUI/packages.config index d6cf4a1..2f6bbf9 100644 --- a/src/SampleLibraryUI/packages.config +++ b/src/SampleLibraryUI/packages.config @@ -1,10 +1,10 @@  - - - - + + + + diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index 0baff16..6a5b0f4 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -38,35 +38,35 @@ false - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -96,11 +96,11 @@ False - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll @@ -126,8 +126,8 @@ False - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll @@ -144,8 +144,12 @@ + + + + diff --git a/src/SampleLibraryZeroTouch/packages.config b/src/SampleLibraryZeroTouch/packages.config index a089e37..c3bcb38 100644 --- a/src/SampleLibraryZeroTouch/packages.config +++ b/src/SampleLibraryZeroTouch/packages.config @@ -1,9 +1,9 @@  - - - + + + diff --git a/src/SampleViewExtension/SampleViewExtension.cs b/src/SampleViewExtension/SampleViewExtension.cs index 525de02..4c52069 100644 --- a/src/SampleViewExtension/SampleViewExtension.cs +++ b/src/SampleViewExtension/SampleViewExtension.cs @@ -51,7 +51,7 @@ public override void Loaded(ViewLoadedParams p) sampleMenuItem = new MenuItem { Header = "Show View Extension Sample Window", IsCheckable = true }; sampleMenuItem.Checked += (sender, args) => p.AddToExtensionsSideBar(this, window); sampleMenuItem.Unchecked += (sender, args) => p.CloseExtensioninInSideBar(this); - p.AddMenuItem(MenuBarType.View, sampleMenuItem); + p.AddExtensionMenuItem(sampleMenuItem); } public override void Shutdown() diff --git a/src/SampleViewExtension/SampleViewExtension.csproj b/src/SampleViewExtension/SampleViewExtension.csproj index afdad95..0b45f5c 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -34,44 +34,44 @@ 4 - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModels.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModels.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\CoreNodeModelsWpf.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModelsWpf.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DesignScriptBuiltin.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSCPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DSIronPython.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoApplications.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.10.0.3455\lib\net48\DynamoCoreWpf.dll + + ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\DynamoCoreWpf.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoInstallDetective.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - ..\packages\DynamoVisualProgramming.DynamoServices.2.10.0.3455\lib\net48\DynamoServices.dll + + ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoShapeManager.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\DynamoUnits.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\DynamoUtilities.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll @@ -100,11 +100,11 @@ - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\ProtoCore.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.10.0.3455\lib\net48\ProtoGeometry.dll + + ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll @@ -136,8 +136,8 @@ - - ..\packages\DynamoVisualProgramming.Core.2.10.0.3455\lib\net48\VMDataBridge.dll + + ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll @@ -156,6 +156,7 @@ + Always diff --git a/src/SampleViewExtension/packages.config b/src/SampleViewExtension/packages.config index d6cf4a1..2f6bbf9 100644 --- a/src/SampleViewExtension/packages.config +++ b/src/SampleViewExtension/packages.config @@ -1,10 +1,10 @@  - - - - + + + + From 5fda0adad54f2ce3f98c7505c99b6c6bd9119695 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" <173288704@qq.com> Date: Mon, 16 Aug 2021 07:44:20 -0400 Subject: [PATCH 08/27] FixBuild (#41) --- src/SampleExtension/SampleExtension.csproj | 14 ++++++-------- src/SampleLibraryTests/SampleLibraryTests.csproj | 4 ---- .../SampleLibraryZeroTouch.csproj | 4 ---- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index 8c37193..670a784 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -141,19 +141,17 @@ - - - \ No newline at end of file diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index 61f23e2..8d3dbfe 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -145,7 +145,6 @@ - PreserveNewest @@ -154,9 +153,6 @@ PreserveNewest - - - diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index 6a5b0f4..254dfa3 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -144,12 +144,8 @@ - - - - From 7667b5cb6b907ce19305116a2dede94040dc7444 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" Date: Tue, 18 Oct 2022 08:41:15 -0700 Subject: [PATCH 09/27] Update NewtonSoft.Json to be v13 (#47) --- src/SampleExtension/SampleExtension.csproj | 6 +++--- src/SampleExtension/app.config | 15 +++++++++++++++ src/SampleExtension/packages.config | 2 +- src/SampleLibraryTests/SampleLibraryTests.csproj | 6 +++--- src/SampleLibraryTests/app.config | 4 ++++ src/SampleLibraryTests/packages.config | 2 +- src/SampleLibraryUI/SampleLibraryUI.csproj | 5 ++--- src/SampleLibraryUI/app.config | 2 +- src/SampleLibraryUI/packages.config | 2 +- .../SampleLibraryZeroTouch.csproj | 6 +++--- src/SampleLibraryZeroTouch/app.config | 15 +++++++++++++++ src/SampleLibraryZeroTouch/packages.config | 2 +- .../SampleViewExtension.csproj | 6 +++--- src/SampleViewExtension/app.config | 15 +++++++++++++++ src/SampleViewExtension/packages.config | 2 +- 15 files changed, 69 insertions(+), 21 deletions(-) create mode 100644 src/SampleExtension/app.config create mode 100644 src/SampleLibraryZeroTouch/app.config create mode 100644 src/SampleViewExtension/app.config diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index 670a784..9ecd138 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -87,9 +87,8 @@ ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - False + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -141,6 +140,7 @@ + diff --git a/src/SampleExtension/app.config b/src/SampleExtension/app.config new file mode 100644 index 0000000..f5bdb8b --- /dev/null +++ b/src/SampleExtension/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SampleExtension/packages.config b/src/SampleExtension/packages.config index 2f6bbf9..54a81e0 100644 --- a/src/SampleExtension/packages.config +++ b/src/SampleExtension/packages.config @@ -5,7 +5,7 @@ - + diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index 8d3dbfe..277ff93 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -85,9 +85,8 @@ ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - False + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll False @@ -145,6 +144,7 @@ + PreserveNewest diff --git a/src/SampleLibraryTests/app.config b/src/SampleLibraryTests/app.config index 409ee74..34a6e87 100644 --- a/src/SampleLibraryTests/app.config +++ b/src/SampleLibraryTests/app.config @@ -14,6 +14,10 @@ + + + + diff --git a/src/SampleLibraryTests/packages.config b/src/SampleLibraryTests/packages.config index 08c675f..7ff169d 100644 --- a/src/SampleLibraryTests/packages.config +++ b/src/SampleLibraryTests/packages.config @@ -5,7 +5,7 @@ - + diff --git a/src/SampleLibraryUI/SampleLibraryUI.csproj b/src/SampleLibraryUI/SampleLibraryUI.csproj index 9885da3..de71af6 100644 --- a/src/SampleLibraryUI/SampleLibraryUI.csproj +++ b/src/SampleLibraryUI/SampleLibraryUI.csproj @@ -95,9 +95,8 @@ ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - False + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\NUnit.2.6.3\lib\nunit.framework.dll diff --git a/src/SampleLibraryUI/app.config b/src/SampleLibraryUI/app.config index 2f9b0f0..7ba3765 100644 --- a/src/SampleLibraryUI/app.config +++ b/src/SampleLibraryUI/app.config @@ -12,7 +12,7 @@ - + diff --git a/src/SampleLibraryUI/packages.config b/src/SampleLibraryUI/packages.config index 2f6bbf9..54a81e0 100644 --- a/src/SampleLibraryUI/packages.config +++ b/src/SampleLibraryUI/packages.config @@ -5,7 +5,7 @@ - + diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index 254dfa3..343295e 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -84,9 +84,8 @@ ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - False + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -144,6 +143,7 @@ + diff --git a/src/SampleLibraryZeroTouch/app.config b/src/SampleLibraryZeroTouch/app.config new file mode 100644 index 0000000..f353fe5 --- /dev/null +++ b/src/SampleLibraryZeroTouch/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SampleLibraryZeroTouch/packages.config b/src/SampleLibraryZeroTouch/packages.config index c3bcb38..c66068e 100644 --- a/src/SampleLibraryZeroTouch/packages.config +++ b/src/SampleLibraryZeroTouch/packages.config @@ -4,7 +4,7 @@ - + diff --git a/src/SampleViewExtension/SampleViewExtension.csproj b/src/SampleViewExtension/SampleViewExtension.csproj index 0b45f5c..101eb58 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -89,9 +89,8 @@ ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - False + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll ..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -162,6 +161,7 @@ + diff --git a/src/SampleViewExtension/app.config b/src/SampleViewExtension/app.config new file mode 100644 index 0000000..f5bdb8b --- /dev/null +++ b/src/SampleViewExtension/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SampleViewExtension/packages.config b/src/SampleViewExtension/packages.config index 2f6bbf9..54a81e0 100644 --- a/src/SampleViewExtension/packages.config +++ b/src/SampleViewExtension/packages.config @@ -5,7 +5,7 @@ - + From 9c76e892dd2e0a38f2ec8dcc4ef2091329e8315c Mon Sep 17 00:00:00 2001 From: John Date: Tue, 1 Aug 2023 09:33:00 -0600 Subject: [PATCH 10/27] Sample Linter (#48) * Initial linter rules * Cleanup * Add settings to the linter for default ungrouped allowance. * Linter sample ready for review. * Fix view extension folder * Remove reference to the sample view extension that I used as a baseline. See: https://github.com/DynamoDS/DynamoSamples/pull/48#discussion_r1258883297 * update gitignore * Add linter packages to gitignore * Retarget to .NET 4.8 * Migrate solution to new style .csproj sdk * Fix sample view extension indentation * Remove packages * Remove extra files to resolve comments from @BogdanZavu * add comments to the linter rules * add localization options for the linter descriptions and call to action --- .../Sample Linter/extra/LinterSettings.xml | 4 + .../SampleLinter_ExtensionDefinition.xml | 4 + dynamo_linter/Sample Linter/pkg.json | 17 ++ src/DynamoSamples.sln | 10 +- src/SampleLinter/LinterSettings.cs | 30 ++++ src/SampleLinter/Properties/AssemblyInfo.cs | 11 ++ .../Properties/Resources.Designer.cs | 117 ++++++++++++ .../Properties/Resources.en-US.Designer.cs | 117 ++++++++++++ .../Properties/Resources.en-US.resx | 138 +++++++++++++++ .../Properties/Resources.es-ES.Designer.cs | 117 ++++++++++++ .../Properties/Resources.es-ES.resx | 138 +++++++++++++++ src/SampleLinter/Properties/Resources.resx | 138 +++++++++++++++ src/SampleLinter/Rules/NoGroupsLinterRule.cs | 111 ++++++++++++ .../Rules/SampleDropdownInputLinterRule.cs | 79 +++++++++ .../Rules/SampleSliderInputLinterRule.cs | 74 ++++++++ src/SampleLinter/SampleLinter.cs | 56 ++++++ src/SampleLinter/SampleLinter.csproj | 167 ++++++++++++++++++ .../SampleLinter_ExtensionDefinition.xml | 4 + src/SampleLinter/app.config | 15 ++ 19 files changed, 1345 insertions(+), 2 deletions(-) create mode 100644 dynamo_linter/Sample Linter/extra/LinterSettings.xml create mode 100644 dynamo_linter/Sample Linter/extra/SampleLinter_ExtensionDefinition.xml create mode 100644 dynamo_linter/Sample Linter/pkg.json create mode 100644 src/SampleLinter/LinterSettings.cs create mode 100644 src/SampleLinter/Properties/AssemblyInfo.cs create mode 100644 src/SampleLinter/Properties/Resources.Designer.cs create mode 100644 src/SampleLinter/Properties/Resources.en-US.Designer.cs create mode 100644 src/SampleLinter/Properties/Resources.en-US.resx create mode 100644 src/SampleLinter/Properties/Resources.es-ES.Designer.cs create mode 100644 src/SampleLinter/Properties/Resources.es-ES.resx create mode 100644 src/SampleLinter/Properties/Resources.resx create mode 100644 src/SampleLinter/Rules/NoGroupsLinterRule.cs create mode 100644 src/SampleLinter/Rules/SampleDropdownInputLinterRule.cs create mode 100644 src/SampleLinter/Rules/SampleSliderInputLinterRule.cs create mode 100644 src/SampleLinter/SampleLinter.cs create mode 100644 src/SampleLinter/SampleLinter.csproj create mode 100644 src/SampleLinter/SampleLinter_ExtensionDefinition.xml create mode 100644 src/SampleLinter/app.config diff --git a/dynamo_linter/Sample Linter/extra/LinterSettings.xml b/dynamo_linter/Sample Linter/extra/LinterSettings.xml new file mode 100644 index 0000000..008283b --- /dev/null +++ b/dynamo_linter/Sample Linter/extra/LinterSettings.xml @@ -0,0 +1,4 @@ + + + 5 + \ No newline at end of file diff --git a/dynamo_linter/Sample Linter/extra/SampleLinter_ExtensionDefinition.xml b/dynamo_linter/Sample Linter/extra/SampleLinter_ExtensionDefinition.xml new file mode 100644 index 0000000..59a0580 --- /dev/null +++ b/dynamo_linter/Sample Linter/extra/SampleLinter_ExtensionDefinition.xml @@ -0,0 +1,4 @@ + + ..\bin\SampleLinter.dll + SampleLinter.SampleLinter + diff --git a/dynamo_linter/Sample Linter/pkg.json b/dynamo_linter/Sample Linter/pkg.json new file mode 100644 index 0000000..d9f7574 --- /dev/null +++ b/dynamo_linter/Sample Linter/pkg.json @@ -0,0 +1,17 @@ +{ + "file_hash":null, + "name":"Sample Linter Extension", + "version":"2.0.1", + "description":"Dynamo sample linter extension.", + "group":"", + "keywords":["dynamo","samples, view, extension, linter"], + "dependencies":[], + "license":"MIT", + "contents":"", + "engine_version":"2.0.1", + "engine_metadata":"", + "engine":"dynamo", + "site_url": "http://dynamobim.org/", + "repository_url": "https://github.com/DynamoDS/DynamoSamples", + "node_libraries": [ ] +} \ No newline at end of file diff --git a/src/DynamoSamples.sln b/src/DynamoSamples.sln index 85b32e6..a9a1d9a 100644 --- a/src/DynamoSamples.sln +++ b/src/DynamoSamples.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33815.320 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleLibraryTests", "SampleLibraryTests\SampleLibraryTests.csproj", "{933B8108-4E74-470A-86C7-4B7F633115B9}" EndProject @@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleViewExtension", "Samp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtension", "SampleExtension\SampleExtension.csproj", "{8B27B070-8434-49C8-8D43-41A4AE53BC36}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleLinter", "SampleLinter\SampleLinter.csproj", "{5F559FDB-99B9-4F4A-9A91-C9EC94C771D8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,6 +41,10 @@ Global {8B27B070-8434-49C8-8D43-41A4AE53BC36}.Debug|Any CPU.Build.0 = Debug|Any CPU {8B27B070-8434-49C8-8D43-41A4AE53BC36}.Release|Any CPU.ActiveCfg = Release|Any CPU {8B27B070-8434-49C8-8D43-41A4AE53BC36}.Release|Any CPU.Build.0 = Release|Any CPU + {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/SampleLinter/LinterSettings.cs b/src/SampleLinter/LinterSettings.cs new file mode 100644 index 0000000..19014d6 --- /dev/null +++ b/src/SampleLinter/LinterSettings.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace SampleLinter +{ + public class LinterSettings + { + [XmlElement("AllowedUngroupedNodes")] + public int AllowedUngroupedNodes { get; set; } = 5; + + public static void SerializeModels(string filename, LinterSettings settings) + { + var xmls = new XmlSerializer(settings.GetType()); + var writer = new StreamWriter(filename); + xmls.Serialize(writer, settings); + writer.Close(); + } + public static LinterSettings DeserializeModels(string filename) + { + var fs = new FileStream(filename, FileMode.Open); + var xmls = new XmlSerializer(typeof(LinterSettings)); + return (LinterSettings)xmls.Deserialize(fs); + } + } +} diff --git a/src/SampleLinter/Properties/AssemblyInfo.cs b/src/SampleLinter/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4f5cdf9 --- /dev/null +++ b/src/SampleLinter/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2EBDA9A0-722E-4C88-826C-62111D4C2C60")] diff --git a/src/SampleLinter/Properties/Resources.Designer.cs b/src/SampleLinter/Properties/Resources.Designer.cs new file mode 100644 index 0000000..9de4081 --- /dev/null +++ b/src/SampleLinter/Properties/Resources.Designer.cs @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SampleLinter.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleLinter.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to If the placed dropdowns are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. + /// + internal static string DropdownCallToAction { + get { + return ResourceManager.GetString("DropdownCallToAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have dropdown nodes placed that are not inputs.. + /// + internal static string DropdownDescription { + get { + return ResourceManager.GetString("DropdownDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have nodes that are not in groups. Grouping your nodes is a best-practice when authoring Dynamo graphs. {0} nodes are allowed outside of groups based on the Linter Settings.. + /// + internal static string NodesNotInGroupsCallToAction { + get { + return ResourceManager.GetString("NodesNotInGroupsCallToAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are {0} nodes that are not in groups.. + /// + internal static string NodesNotInGroupsDescription { + get { + return ResourceManager.GetString("NodesNotInGroupsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If the placed number sliders are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. + /// + internal static string SlidersCallToAction { + get { + return ResourceManager.GetString("SlidersCallToAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have number sliders placed that are not inputs.. + /// + internal static string SlidersDescription { + get { + return ResourceManager.GetString("SlidersDescription", resourceCulture); + } + } + } +} diff --git a/src/SampleLinter/Properties/Resources.en-US.Designer.cs b/src/SampleLinter/Properties/Resources.en-US.Designer.cs new file mode 100644 index 0000000..8c7b872 --- /dev/null +++ b/src/SampleLinter/Properties/Resources.en-US.Designer.cs @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SampleLinter.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources___Copy { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources___Copy() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleLinter.Properties.Resources - Copy", typeof(Resources___Copy).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to If the placed dropdowns are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. + /// + internal static string DropdownCallToAction { + get { + return ResourceManager.GetString("DropdownCallToAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have dropdown nodes placed that are not inputs.. + /// + internal static string DropdownDescription { + get { + return ResourceManager.GetString("DropdownDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have nodes that are not in groups. Grouping your nodes is a best-practice when authoring Dynamo graphs. {0} nodes are allowed outside of groups based on the Linter Settings.. + /// + internal static string NodesNotInGroupsCallToAction { + get { + return ResourceManager.GetString("NodesNotInGroupsCallToAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are {0} nodes that are not in groups.. + /// + internal static string NodesNotInGroupsDescription { + get { + return ResourceManager.GetString("NodesNotInGroupsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If the placed number sliders are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. + /// + internal static string SlidersCallToAction { + get { + return ResourceManager.GetString("SlidersCallToAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have number sliders placed that are not inputs.. + /// + internal static string SlidersDescription { + get { + return ResourceManager.GetString("SlidersDescription", resourceCulture); + } + } + } +} diff --git a/src/SampleLinter/Properties/Resources.en-US.resx b/src/SampleLinter/Properties/Resources.en-US.resx new file mode 100644 index 0000000..078d87d --- /dev/null +++ b/src/SampleLinter/Properties/Resources.en-US.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + If the placed dropdowns are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node. + + + You have dropdown nodes placed that are not inputs. + + + You have nodes that are not in groups. Grouping your nodes is a best-practice when authoring Dynamo graphs. {0} nodes are allowed outside of groups based on the Linter Settings. + + + There are {0} nodes that are not in groups. + + + If the placed number sliders are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node. + + + You have number sliders placed that are not inputs. + + \ No newline at end of file diff --git a/src/SampleLinter/Properties/Resources.es-ES.Designer.cs b/src/SampleLinter/Properties/Resources.es-ES.Designer.cs new file mode 100644 index 0000000..8c7b872 --- /dev/null +++ b/src/SampleLinter/Properties/Resources.es-ES.Designer.cs @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SampleLinter.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources___Copy { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources___Copy() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleLinter.Properties.Resources - Copy", typeof(Resources___Copy).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to If the placed dropdowns are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. + /// + internal static string DropdownCallToAction { + get { + return ResourceManager.GetString("DropdownCallToAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have dropdown nodes placed that are not inputs.. + /// + internal static string DropdownDescription { + get { + return ResourceManager.GetString("DropdownDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have nodes that are not in groups. Grouping your nodes is a best-practice when authoring Dynamo graphs. {0} nodes are allowed outside of groups based on the Linter Settings.. + /// + internal static string NodesNotInGroupsCallToAction { + get { + return ResourceManager.GetString("NodesNotInGroupsCallToAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are {0} nodes that are not in groups.. + /// + internal static string NodesNotInGroupsDescription { + get { + return ResourceManager.GetString("NodesNotInGroupsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If the placed number sliders are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. + /// + internal static string SlidersCallToAction { + get { + return ResourceManager.GetString("SlidersCallToAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have number sliders placed that are not inputs.. + /// + internal static string SlidersDescription { + get { + return ResourceManager.GetString("SlidersDescription", resourceCulture); + } + } + } +} diff --git a/src/SampleLinter/Properties/Resources.es-ES.resx b/src/SampleLinter/Properties/Resources.es-ES.resx new file mode 100644 index 0000000..f997c05 --- /dev/null +++ b/src/SampleLinter/Properties/Resources.es-ES.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Si los dropdowns desplegables colocados deben ser entradas, recuerde cambiarles el nombre y marcarlos como entrada. Si no los necesita como entradas, considere un node alternativo. + + + Tiene dropdowns colocados que no son entradas. + + + Tiene nodes que no están en grupos. Agrupar sus nodos es una práctica recomendada al crear gráficos de Dynamo. Se permiten {0} nodes fuera de los grupos según la configuración de Linter. + + + Hay {0} nodes que no están en grupos. + + + Si los controles deslizantes numéricos colocados deben ser entradas, recuerde cambiarles el nombre y marcarlos como entrada. Si no los necesita como entradas, considere un nodo alternativo. + + + Tiene deslizadores sliders colocados que no son entradas. + + \ No newline at end of file diff --git a/src/SampleLinter/Properties/Resources.resx b/src/SampleLinter/Properties/Resources.resx new file mode 100644 index 0000000..078d87d --- /dev/null +++ b/src/SampleLinter/Properties/Resources.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + If the placed dropdowns are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node. + + + You have dropdown nodes placed that are not inputs. + + + You have nodes that are not in groups. Grouping your nodes is a best-practice when authoring Dynamo graphs. {0} nodes are allowed outside of groups based on the Linter Settings. + + + There are {0} nodes that are not in groups. + + + If the placed number sliders are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node. + + + You have number sliders placed that are not inputs. + + \ No newline at end of file diff --git a/src/SampleLinter/Rules/NoGroupsLinterRule.cs b/src/SampleLinter/Rules/NoGroupsLinterRule.cs new file mode 100644 index 0000000..8933840 --- /dev/null +++ b/src/SampleLinter/Rules/NoGroupsLinterRule.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Dynamo.Graph.Nodes; +using Dynamo.Graph.Workspaces; +using Dynamo.Linting.Interfaces; +using Dynamo.Linting.Rules; + +namespace SampleLinter.Rules +{ + /// + /// Having ungrouped nodes is a bad practice. This section allows the linter to flag this behavior based on linter settings in the extra folder in the extension directory. + /// This example node uses .net .resx files and generated satellite assemblies to perform runtime lookup of localized content + /// depending on the culture of the system Dynamo is running on. + /// Read more: https://docs.microsoft.com/en-us/dotnet/framework/resources/creating-resource-files-for-desktop-apps + /// You can use the -l "es-ES" flag when starting DynamoSandbox.exe to replace the English strings with Spanish ones. + /// For more info on the CLI interface read more: https://github.com/DynamoDS/Dynamo/wiki/Dynamo-Command-Line-Interface + /// + public class NoGroupsLinterRule : GraphLinterRule + { + public override string Id => "EF17A093-4E94-4AE9-8876-18631396A23A"; //this id is unique to each linter rule + public override SeverityCodesEnum SeverityCode => SeverityCodesEnum.Warning; + + public override string Description => + string.Format(Properties.Resources.NodesNotInGroupsDescription, _nodesNotInGroups.Count); + public override string CallToAction => string.Format(Properties.Resources.NodesNotInGroupsDescription, _ungroupedAllowed); + + //To store our ungrouped nodes for counts and checks + private readonly List _nodesNotInGroups = new List(); + + //Allow the end-user to have a few nodes outside of groups. We don't want to be too overbearing. + private readonly int _ungroupedAllowed; + + public NoGroupsLinterRule(LinterSettings linterSettings) + { + _ungroupedAllowed = linterSettings.AllowedUngroupedNodes; + } + + public override List EvaluationTriggerEvents => + new List() + { + "Modified" + }; + + protected override Tuple> EvaluateFunction(WorkspaceModel workspaceModel, string changedEvent, NodeModel nodeModel = null) + { + //clear our list as we are reevaluating the graph + _nodesNotInGroups.Clear(); + + if (workspaceModel != null) + { + //check each node for grouping + foreach (var node in workspaceModel.Nodes) + { + CheckNodeForGroup(node, workspaceModel); + } + } + + var result = _nodesNotInGroups.Count > _ungroupedAllowed ? RuleEvaluationStatusEnum.Failed : RuleEvaluationStatusEnum.Passed; + + return new Tuple>(result, new HashSet()); + } + + + + protected override List>> InitFunction(WorkspaceModel workspaceModel) + { + _nodesNotInGroups.Clear(); + + //create a list to hold results information. + //The Tuple should be of a RuleEvaluationStatus and the name of the node + List> results = new List>(); + + //Iterate over all the nodes in the workspace + foreach (NodeModel node in workspaceModel.Nodes) + { + CheckNodeForGroup(node, workspaceModel); + } + + return new List>> { EvaluateFunction(workspaceModel, "initialize") }; + } + + private void CheckNodeForGroup(NodeModel nodeModel, WorkspaceModel workspaceModel) + { + //collect current groups from file + var groups = workspaceModel.Annotations.ToList(); + + //if there are no groups, return all of the current nodes + if (!groups.Any()) + { + _nodesNotInGroups.Clear(); + _nodesNotInGroups.AddRange(workspaceModel.Nodes); + + return; + }; + + //check if the node is in any of the groups. If not add it to our list. + if (!groups.Any(g => g.Nodes.Any(n => n.GUID.Equals(nodeModel.GUID)))) + { + _nodesNotInGroups.Add(nodeModel); + } + //the node is in a group, remove it from the list if applicable + else + { + _nodesNotInGroups.Remove(nodeModel); + } + } + } + + +} diff --git a/src/SampleLinter/Rules/SampleDropdownInputLinterRule.cs b/src/SampleLinter/Rules/SampleDropdownInputLinterRule.cs new file mode 100644 index 0000000..abe200a --- /dev/null +++ b/src/SampleLinter/Rules/SampleDropdownInputLinterRule.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using Dynamo.Graph.Nodes; +using Dynamo.Graph.Workspaces; +using Dynamo.Linting.Interfaces; +using Dynamo.Linting.Rules; + +namespace SampleLinter.Rules +{ + /// + /// Similar to the slider rule, but for dropdowns. If you aren't using it as an input, it is worth considering an alternative. + /// Having ungrouped nodes is a bad practice. This section allows the linter to flag this behavior based on linter settings in the extra folder in the extension directory. + /// This example node uses .net .resx files and generated satellite assemblies to perform runtime lookup of localized content + /// depending on the culture of the system Dynamo is running on. + /// Read more: https://docs.microsoft.com/en-us/dotnet/framework/resources/creating-resource-files-for-desktop-apps + /// You can use the -l "es-ES" flag when starting DynamoSandbox.exe to replace the English strings with Spanish ones. + /// For more info on the CLI interface read more: https://github.com/DynamoDS/Dynamo/wiki/Dynamo-Command-Line-Interface + /// + internal class SampleDropdownInputLinterRule : NodeLinterRule + { + public override string Id => "E4EC24B8-8F87-42B3-874F-A3DB3A69098A"; + public override SeverityCodesEnum SeverityCode => SeverityCodesEnum.Warning; + + public override string Description => Properties.Resources.DropdownDescription; + + public override string CallToAction => Properties.Resources.DropdownDescription; + + public override List EvaluationTriggerEvents => + new List() + { + nameof(NodeModel.IsSetAsInput), + nameof(NodeModel.State), + }; + + + protected override RuleEvaluationStatusEnum EvaluateFunction(NodeModel nodeModel, string changedEvent) + { + if (nodeModel != null) + { + if (nodeModel.NodeType.Equals("ExtensionNode")) + { + if (!nodeModel.IsSetAsInput) + { + return RuleEvaluationStatusEnum.Failed; + } + } + } + + return RuleEvaluationStatusEnum.Passed; + } + + + protected override List> InitFunction(WorkspaceModel workspaceModel) + { + //create a list to hold results information. + //The Tuple should be of a RuleEvaluationStatus and the name of the node + List> results = new List>(); + + //Iterate over all the nodes in the workspace + foreach (NodeModel node in workspaceModel.Nodes) + { + //Call the Evaluate function + var evaluationStatus = EvaluateFunction(node, "initialize"); + + //Check what happened for this node. If it passed the we continue + if (evaluationStatus == RuleEvaluationStatusEnum.Passed) + continue; + + //Create the tuple to return and add it to the result list + var valueTuple = Tuple.Create(evaluationStatus, node.GUID.ToString()); + results.Add(valueTuple); + } + + return results; + } + } + + +} diff --git a/src/SampleLinter/Rules/SampleSliderInputLinterRule.cs b/src/SampleLinter/Rules/SampleSliderInputLinterRule.cs new file mode 100644 index 0000000..54c59c0 --- /dev/null +++ b/src/SampleLinter/Rules/SampleSliderInputLinterRule.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using CoreNodeModels.Input; +using Dynamo.Graph.Nodes; +using Dynamo.Graph.Workspaces; +using Dynamo.Linting.Interfaces; +using Dynamo.Linting.Rules; + +namespace SampleLinter.Rules +{ + /// + /// This rule alerts the end user that they might want to do so if the slider is not input or renamed. If a slider is not being used as input, it is typically unnecessary and a number node or a code block would suffice. + /// + internal class SampleSliderInputLinterRule : NodeLinterRule + { + public override string Id => "54EFD003-FF02-41B6-9F2E-52216BA23844"; + public override SeverityCodesEnum SeverityCode => SeverityCodesEnum.Warning; + + public override string Description => Properties.Resources.SlidersDescription; + + public override string CallToAction => Properties.Resources.SlidersCallToAction; + + public override List EvaluationTriggerEvents => + new List() + { + nameof(NodeModel.IsSetAsInput), + nameof(NodeModel.State), + }; + + + protected override RuleEvaluationStatusEnum EvaluateFunction(NodeModel nodeModel, string changedEvent) + { + if (nodeModel != null) + { + if (nodeModel is DoubleSlider || (nodeModel is IntegerSlider64Bit)) + { + if (!nodeModel.IsSetAsInput) + { + return RuleEvaluationStatusEnum.Failed; + } + } + } + + return RuleEvaluationStatusEnum.Passed; + } + + + protected override List> InitFunction(WorkspaceModel workspaceModel) + { + //create a list to hold results information. + //The Tuple should be of a RuleEvaluationStatus and the name of the node + List> results = new List>(); + + //Iterate over all the nodes in the workspace + foreach (NodeModel node in workspaceModel.Nodes) + { + //Call the Evaluate function + var evaluationStatus = EvaluateFunction(node, "initialize"); + + //Check what happened for this node. If it passed the we continue + if (evaluationStatus == RuleEvaluationStatusEnum.Passed) + continue; + + //Create the tuple to return and add it to the result list + var valueTuple = Tuple.Create(evaluationStatus, node.GUID.ToString()); + results.Add(valueTuple); + } + + return results; + } + } + + +} diff --git a/src/SampleLinter/SampleLinter.cs b/src/SampleLinter/SampleLinter.cs new file mode 100644 index 0000000..5da3873 --- /dev/null +++ b/src/SampleLinter/SampleLinter.cs @@ -0,0 +1,56 @@ +using System; +using System.IO; +using Dynamo.Extensions; +using Dynamo.Logging; +using SampleLinter.Rules; + +namespace SampleLinter +{ + public class SampleLinter : LinterExtensionBase + { + public override string UniqueId => "44BAAD49-4750-47BE-AB60-61DD30962FAE"; //this is unique to this linter + public override string Name => "Sample Linter"; + + + private SampleSliderInputLinterRule _sliderInputRule; + private SampleDropdownInputLinterRule _DropdownRule; + private NoGroupsLinterRule _noGroupsRule; + + private LinterSettings _linterSettings; + + public override void Ready(ReadyParams rp) + { + //load our settings + var extensionDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)?.Replace("bin","extra"); + var settingsFile = Path.Combine(extensionDirectory, "LinterSettings.xml"); + //if the settings file exists, use it, if not load with default 5 ungrouped allowed + _linterSettings = File.Exists(settingsFile) ? LinterSettings.DeserializeModels(settingsFile) : new LinterSettings(){AllowedUngroupedNodes = 5}; + + + //since we are inheriting from the LinterExtensionBase we need to mark it as ready here + base.Ready(rp); + + //add each of our rules to the linter + _sliderInputRule = new SampleSliderInputLinterRule(); + AddLinterRule(_sliderInputRule); + + _DropdownRule = new SampleDropdownInputLinterRule(); + AddLinterRule(_DropdownRule); + + _noGroupsRule = new NoGroupsLinterRule(_linterSettings); + AddLinterRule(_noGroupsRule); + } + + + + + public override void Shutdown() + { + RemoveLinterRule(_sliderInputRule); + RemoveLinterRule(_DropdownRule); + RemoveLinterRule(_noGroupsRule); + } + + + } +} diff --git a/src/SampleLinter/SampleLinter.csproj b/src/SampleLinter/SampleLinter.csproj new file mode 100644 index 0000000..d33b799 --- /dev/null +++ b/src/SampleLinter/SampleLinter.csproj @@ -0,0 +1,167 @@ + + + {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8} + net48 + SampleLinter + SampleLinter + Copyright © 2023 + 2.0.1.0 + 2.0.1.0 + bin\$(Configuration)\ + $(BuildDependsOn);AfterBuildMigrated + + + full + + + pdbonly + + + + + + + + + + + + + + + + + + + + + + + + + + packages\DynamoVisualProgramming.WpfUILibrary.2.18.1.5096\lib\net48\CoreNodeModels.dll + + + packages\DynamoVisualProgramming.WpfUILibrary.2.18.1.5096\lib\net48\CoreNodeModelsWpf.dll + + + packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DesignScriptBuiltin.dll + + + packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DSCPython.dll + + + packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoApplications.dll + + + packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoCore.dll + + + packages\DynamoVisualProgramming.WpfUILibrary.2.18.1.5096\lib\net48\DynamoCoreWpf.dll + + + packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoInstallDetective.dll + + + packages\DynamoVisualProgramming.DynamoServices.2.18.1.5096\lib\netstandard2.0\DynamoServices.dll + + + packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoShapeManager.dll + + + packages\DynamoVisualProgramming.ZeroTouchLibrary.2.18.1.5096\lib\net48\DynamoUnits.dll + + + packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoUtilities.dll + + + packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll + + + packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll + + + packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll + + + packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll + + + packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + + + packages\NUnit.2.6.3\lib\nunit.framework.dll + + + + + packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\ProtoCore.dll + + + packages\DynamoVisualProgramming.ZeroTouchLibrary.2.18.1.5096\lib\net48\ProtoGeometry.dll + + + packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll + + + packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll + + + + + + + packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\VMDataBridge.dll + + + + + + Always + + + + + Resources.es-ES.resx + True + True + + + Resources.en-US.resx + True + True + + + True + True + Resources.resx + + + + + Resources.es-ES.Designer.cs + ResXFileCodeGenerator + + + Resources.en-US.Designer.cs + ResXFileCodeGenerator + + + ResXFileCodeGenerator + Resources.Designer.cs + + + \ No newline at end of file diff --git a/src/SampleLinter/SampleLinter_ExtensionDefinition.xml b/src/SampleLinter/SampleLinter_ExtensionDefinition.xml new file mode 100644 index 0000000..59a0580 --- /dev/null +++ b/src/SampleLinter/SampleLinter_ExtensionDefinition.xml @@ -0,0 +1,4 @@ + + ..\bin\SampleLinter.dll + SampleLinter.SampleLinter + diff --git a/src/SampleLinter/app.config b/src/SampleLinter/app.config new file mode 100644 index 0000000..0150915 --- /dev/null +++ b/src/SampleLinter/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + From a8d5e57f3fb87ec1a25e7c6cc351e3514be0df43 Mon Sep 17 00:00:00 2001 From: Michael Kirschner Date: Tue, 8 Aug 2023 16:24:46 -0400 Subject: [PATCH 11/27] fix the build and add copy steps for linter (#49) * fix build * fix build some copy steps cleanup build output --- dynamo_linter/Sample Linter/extra/.gitignore | 0 .../SampleExtension_ExtensionDefinition.xml | 4 + src/SampleLinter/LinterSettings.xml | 4 + .../Properties/Resources.Designer.cs | 18 +- .../Properties/Resources.en-US.Designer.cs | 117 ------------ .../Properties/Resources.es-ES.Designer.cs | 117 ------------ src/SampleLinter/SampleLinter.csproj | 167 +++++------------- 7 files changed, 58 insertions(+), 369 deletions(-) create mode 100644 dynamo_linter/Sample Linter/extra/.gitignore create mode 100644 dynamo_package/Dynamo Samples/extra/SampleExtension_ExtensionDefinition.xml create mode 100644 src/SampleLinter/LinterSettings.xml delete mode 100644 src/SampleLinter/Properties/Resources.en-US.Designer.cs delete mode 100644 src/SampleLinter/Properties/Resources.es-ES.Designer.cs diff --git a/dynamo_linter/Sample Linter/extra/.gitignore b/dynamo_linter/Sample Linter/extra/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/dynamo_package/Dynamo Samples/extra/SampleExtension_ExtensionDefinition.xml b/dynamo_package/Dynamo Samples/extra/SampleExtension_ExtensionDefinition.xml new file mode 100644 index 0000000..2a3054a --- /dev/null +++ b/dynamo_package/Dynamo Samples/extra/SampleExtension_ExtensionDefinition.xml @@ -0,0 +1,4 @@ + + ..\bin\SampleExtension.dll + SampleExtension.Extension + diff --git a/src/SampleLinter/LinterSettings.xml b/src/SampleLinter/LinterSettings.xml new file mode 100644 index 0000000..008283b --- /dev/null +++ b/src/SampleLinter/LinterSettings.xml @@ -0,0 +1,4 @@ + + + 5 + \ No newline at end of file diff --git a/src/SampleLinter/Properties/Resources.Designer.cs b/src/SampleLinter/Properties/Resources.Designer.cs index 9de4081..06524c5 100644 --- a/src/SampleLinter/Properties/Resources.Designer.cs +++ b/src/SampleLinter/Properties/Resources.Designer.cs @@ -22,7 +22,7 @@ namespace SampleLinter.Properties { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { + public class Resources { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ internal Resources() { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleLinter.Properties.Resources", typeof(Resources).Assembly); @@ -51,7 +51,7 @@ internal Resources() { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ internal Resources() { /// /// Looks up a localized string similar to If the placed dropdowns are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. /// - internal static string DropdownCallToAction { + public static string DropdownCallToAction { get { return ResourceManager.GetString("DropdownCallToAction", resourceCulture); } @@ -72,7 +72,7 @@ internal static string DropdownCallToAction { /// /// Looks up a localized string similar to You have dropdown nodes placed that are not inputs.. /// - internal static string DropdownDescription { + public static string DropdownDescription { get { return ResourceManager.GetString("DropdownDescription", resourceCulture); } @@ -81,7 +81,7 @@ internal static string DropdownDescription { /// /// Looks up a localized string similar to You have nodes that are not in groups. Grouping your nodes is a best-practice when authoring Dynamo graphs. {0} nodes are allowed outside of groups based on the Linter Settings.. /// - internal static string NodesNotInGroupsCallToAction { + public static string NodesNotInGroupsCallToAction { get { return ResourceManager.GetString("NodesNotInGroupsCallToAction", resourceCulture); } @@ -90,7 +90,7 @@ internal static string NodesNotInGroupsCallToAction { /// /// Looks up a localized string similar to There are {0} nodes that are not in groups.. /// - internal static string NodesNotInGroupsDescription { + public static string NodesNotInGroupsDescription { get { return ResourceManager.GetString("NodesNotInGroupsDescription", resourceCulture); } @@ -99,7 +99,7 @@ internal static string NodesNotInGroupsDescription { /// /// Looks up a localized string similar to If the placed number sliders are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. /// - internal static string SlidersCallToAction { + public static string SlidersCallToAction { get { return ResourceManager.GetString("SlidersCallToAction", resourceCulture); } @@ -108,7 +108,7 @@ internal static string SlidersCallToAction { /// /// Looks up a localized string similar to You have number sliders placed that are not inputs.. /// - internal static string SlidersDescription { + public static string SlidersDescription { get { return ResourceManager.GetString("SlidersDescription", resourceCulture); } diff --git a/src/SampleLinter/Properties/Resources.en-US.Designer.cs b/src/SampleLinter/Properties/Resources.en-US.Designer.cs deleted file mode 100644 index 8c7b872..0000000 --- a/src/SampleLinter/Properties/Resources.en-US.Designer.cs +++ /dev/null @@ -1,117 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SampleLinter.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources___Copy { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources___Copy() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleLinter.Properties.Resources - Copy", typeof(Resources___Copy).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to If the placed dropdowns are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. - /// - internal static string DropdownCallToAction { - get { - return ResourceManager.GetString("DropdownCallToAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You have dropdown nodes placed that are not inputs.. - /// - internal static string DropdownDescription { - get { - return ResourceManager.GetString("DropdownDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You have nodes that are not in groups. Grouping your nodes is a best-practice when authoring Dynamo graphs. {0} nodes are allowed outside of groups based on the Linter Settings.. - /// - internal static string NodesNotInGroupsCallToAction { - get { - return ResourceManager.GetString("NodesNotInGroupsCallToAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There are {0} nodes that are not in groups.. - /// - internal static string NodesNotInGroupsDescription { - get { - return ResourceManager.GetString("NodesNotInGroupsDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to If the placed number sliders are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. - /// - internal static string SlidersCallToAction { - get { - return ResourceManager.GetString("SlidersCallToAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You have number sliders placed that are not inputs.. - /// - internal static string SlidersDescription { - get { - return ResourceManager.GetString("SlidersDescription", resourceCulture); - } - } - } -} diff --git a/src/SampleLinter/Properties/Resources.es-ES.Designer.cs b/src/SampleLinter/Properties/Resources.es-ES.Designer.cs deleted file mode 100644 index 8c7b872..0000000 --- a/src/SampleLinter/Properties/Resources.es-ES.Designer.cs +++ /dev/null @@ -1,117 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SampleLinter.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources___Copy { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources___Copy() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleLinter.Properties.Resources - Copy", typeof(Resources___Copy).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to If the placed dropdowns are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. - /// - internal static string DropdownCallToAction { - get { - return ResourceManager.GetString("DropdownCallToAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You have dropdown nodes placed that are not inputs.. - /// - internal static string DropdownDescription { - get { - return ResourceManager.GetString("DropdownDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You have nodes that are not in groups. Grouping your nodes is a best-practice when authoring Dynamo graphs. {0} nodes are allowed outside of groups based on the Linter Settings.. - /// - internal static string NodesNotInGroupsCallToAction { - get { - return ResourceManager.GetString("NodesNotInGroupsCallToAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to There are {0} nodes that are not in groups.. - /// - internal static string NodesNotInGroupsDescription { - get { - return ResourceManager.GetString("NodesNotInGroupsDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to If the placed number sliders are needing to be inputs, remember to rename them and mark them as input. If you do not need these as inputs, consider an alternative node.. - /// - internal static string SlidersCallToAction { - get { - return ResourceManager.GetString("SlidersCallToAction", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You have number sliders placed that are not inputs.. - /// - internal static string SlidersDescription { - get { - return ResourceManager.GetString("SlidersDescription", resourceCulture); - } - } - } -} diff --git a/src/SampleLinter/SampleLinter.csproj b/src/SampleLinter/SampleLinter.csproj index d33b799..d0dd566 100644 --- a/src/SampleLinter/SampleLinter.csproj +++ b/src/SampleLinter/SampleLinter.csproj @@ -8,7 +8,6 @@ 2.0.1.0 2.0.1.0 bin\$(Configuration)\ - $(BuildDependsOn);AfterBuildMigrated full @@ -17,116 +16,42 @@ pdbonly - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - packages\DynamoVisualProgramming.WpfUILibrary.2.18.1.5096\lib\net48\CoreNodeModels.dll - - - packages\DynamoVisualProgramming.WpfUILibrary.2.18.1.5096\lib\net48\CoreNodeModelsWpf.dll - - - packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DesignScriptBuiltin.dll - - - packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DSCPython.dll - - - packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoApplications.dll - - - packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoCore.dll - - - packages\DynamoVisualProgramming.WpfUILibrary.2.18.1.5096\lib\net48\DynamoCoreWpf.dll - - - packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoInstallDetective.dll - - - packages\DynamoVisualProgramming.DynamoServices.2.18.1.5096\lib\netstandard2.0\DynamoServices.dll - - - packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoShapeManager.dll - - - packages\DynamoVisualProgramming.ZeroTouchLibrary.2.18.1.5096\lib\net48\DynamoUnits.dll - - - packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\DynamoUtilities.dll - - - packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll - - - packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll - - - packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll - - - packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll - - - packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - packages\NUnit.2.6.3\lib\nunit.framework.dll - - - - - packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\ProtoCore.dll - - - packages\DynamoVisualProgramming.ZeroTouchLibrary.2.18.1.5096\lib\net48\ProtoGeometry.dll - - - packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll - - - packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll - - - - - - - packages\DynamoVisualProgramming.Core.2.18.1.5096\lib\net48\VMDataBridge.dll - - + + + + Runtime + + + + + Runtime + + + + + Runtime + + + + + Runtime + + + + + Runtime + @@ -134,16 +59,6 @@ - - Resources.es-ES.resx - True - True - - - Resources.en-US.resx - True - True - True True @@ -151,17 +66,17 @@ - - Resources.es-ES.Designer.cs - ResXFileCodeGenerator - - Resources.en-US.Designer.cs - ResXFileCodeGenerator + - ResXFileCodeGenerator + PublicResXFileCodeGenerator Resources.Designer.cs + + + Always + + \ No newline at end of file From 62c0c33fe994932cb9f9b1275c0a073aa1fb94b0 Mon Sep 17 00:00:00 2001 From: pinzart90 <46732933+pinzart90@users.noreply.github.com> Date: Thu, 11 Jan 2024 16:04:27 -0500 Subject: [PATCH 12/27] update for the Dynamo 3.0 release (#50) * update * update * update * update * Create Setup.cs * update trace * Update PeriodicUpdateExample.cs * update * Update Setup.cs * update * update --------- Co-authored-by: pinzart --- .github/dependabot.yml | 8 + .../workflows/build_dynamo_samples_net8.0.yml | 62 +++++ appveyor.yml | 14 -- src/Config/CS.props | 54 +++-- src/SampleExtension/SampleExtension.csproj | 158 +------------ src/SampleExtension/app.config | 15 -- src/SampleExtension/packages.config | 16 -- .../SampleIntegration.csproj | 58 +---- src/SampleIntegration/TracedHog.cs | 9 +- .../HelloDynamoSystemTests.cs | 2 +- .../SampleLibraryTests.csproj | 156 +------------ src/SampleLibraryTests/Setup.cs | 84 +++++++ .../TestServices.dll.config | 7 - src/SampleLibraryTests/app.config | 23 -- src/SampleLibraryTests/packages.config | 16 -- src/SampleLibraryUI/SampleLibraryUI.csproj | 214 ++---------------- src/SampleLibraryUI/app.config | 23 -- src/SampleLibraryUI/packages.config | 16 -- .../Examples/BasicExample.cs | 1 - .../Examples/PeriodicUpdateExample.cs | 14 +- .../Examples/TraceExample.cs | 8 +- .../SampleLibraryZeroTouch.csproj | 162 +------------ src/SampleLibraryZeroTouch/packages.config | 15 -- src/SampleLinter/SampleLinter.csproj | 88 ++----- src/SampleLinter/app.config | 15 -- .../SampleViewExtension.csproj | 175 +------------- src/SampleViewExtension/app.config | 15 -- src/SampleViewExtension/packages.config | 16 -- 28 files changed, 297 insertions(+), 1147 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build_dynamo_samples_net8.0.yml delete mode 100644 appveyor.yml delete mode 100644 src/SampleExtension/app.config delete mode 100644 src/SampleExtension/packages.config create mode 100644 src/SampleLibraryTests/Setup.cs delete mode 100644 src/SampleLibraryTests/TestServices.dll.config delete mode 100644 src/SampleLibraryTests/app.config delete mode 100644 src/SampleLibraryTests/packages.config delete mode 100644 src/SampleLibraryUI/app.config delete mode 100644 src/SampleLibraryUI/packages.config delete mode 100644 src/SampleLibraryZeroTouch/packages.config delete mode 100644 src/SampleLinter/app.config delete mode 100644 src/SampleViewExtension/app.config delete mode 100644 src/SampleViewExtension/packages.config diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..aaf2397 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: ".github/workflows" + schedule: + interval: "weekly" diff --git a/.github/workflows/build_dynamo_samples_net8.0.yml b/.github/workflows/build_dynamo_samples_net8.0.yml new file mode 100644 index 0000000..1d35049 --- /dev/null +++ b/.github/workflows/build_dynamo_samples_net8.0.yml @@ -0,0 +1,62 @@ +# Build DynamoAll.sln with .NET 8.0 +name: Build DynamoSamples.sln net8.0 + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout DynamoSamples Repo + uses: actions/checkout@v4 + with: + path: DynamoSamples + repository: DynamoDS/DynamoSamples + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + - name: Disable problem matcher + run: echo "::remove-matcher owner=csc::" + - name: Install dependencies for SampleIntegration + run: | + dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release --runtime=win-x64 + - name: Build SampleIntegration with MSBuild for Windows + run: | + echo "***Continue with the build, Good luck developer!***" + cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\" + .\MSBuild.exe $Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release + # look for DynamoSamples outputs + - name: Navigate to SampleIntegration Folder + run: | + cd "$Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\bin\Release" + echo "***Locating SampleIntegration.dll for Windows!***" + test ".\SampleIntegration.dll" && echo "SampleIntegration.dll exists!" + - name: Install dependencies for windows runtime + run: | + dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release --runtime=win-x64 + - name: Build DynamoSamples with MSBuild for Windows + run: | + echo "***Continue with the build, Good luck developer!***" + cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\" + .\MSBuild.exe $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release + # look for DynamoSamples outputs + - name: Navigate to dynamo_linter Folder + run: | + cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_linter\Sample Linter\bin" + echo "***Locating SampleLinter.dll for Windows!***" + test ".\SampleLinter.dll" && echo "SampleLinter.dll exists!" + - name: Navigate to dynamo_package Folder + run: | + cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_package\Dynamo Samples\bin" + echo "***Locating dynamo_package dlls for Windows!***" + test ".\SampleLibraryUI.dll" && echo "SampleLibraryUI.dll exists!" && test ".\SampleLibraryZeroTouch.dll" && echo "SampleLibraryZeroTouch.dll exists!" + - name: Navigate to dynamo_viewExtension Folder + run: | + cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_viewExtension\Sample View Extension\bin" + echo "***Locating SampleViewExtension.dll for Windows!***" + test ".\SampleViewExtension.dll" && echo "SampleViewExtension.dll exists!" diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index d8928f9..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 1.0.{build} - -platform: Any CPU - -configuration: Release - -build: - project: src/DynamoSamples.sln - verbosity: normal - -test: off - -before_build: - - nuget restore .\src\DynamoSamples.sln \ No newline at end of file diff --git a/src/Config/CS.props b/src/Config/CS.props index e981e9b..07ee8e9 100644 --- a/src/Config/CS.props +++ b/src/Config/CS.props @@ -1,14 +1,42 @@ - - - - - + - $(SolutionDir)\packages\DynamoVisualProgramming.Core.1.0.0-beta3\lib\net45 - $(SolutionDir)\packages\DynamoVisualProgramming.ZeroTouchLibrary.1.0.0-beta3\lib\net45 - $(SolutionDir)\packages\DynamoVisualProgramming.WpfUILibrary.1.0.0-beta4\lib\net45 - $(DynamoWpfUIPath) - $(SolutionDir)\packages\DynamoVisualProgramming.DynamoServices.1.0.0-beta3\lib\net45 - $(SolutionDir)\packages\DynamoVisualProgramming.Tests.1.0.0-beta4\lib\net45 - - + Debug + AnyCPU + x64 + net8.0 + 512 + false + false + prompt + 4 + false + en-US + Library + false + None + true + false + + + full + + + true + full + false + bin\Debug\ + TRACE;DEBUG + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + \ No newline at end of file diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index 9ecd138..fb4c133 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -1,157 +1,21 @@ - - - + + + + Debug - AnyCPU - {8B27B070-8434-49C8-8D43-41A4AE53BC36} - Library - Properties SampleExtension SampleExtension - v4.8 - 512 - + + + true - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModels.dll - - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModelsWpf.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\DynamoCoreWpf.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - - ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll - False - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll - False - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll - False - - - ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - False - - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll - - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - ..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll - - - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll - False - - - - - - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll - - - - - - - - - + + Always + - + - - \ No newline at end of file diff --git a/src/SampleExtension/app.config b/src/SampleExtension/app.config deleted file mode 100644 index f5bdb8b..0000000 --- a/src/SampleExtension/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SampleExtension/packages.config b/src/SampleExtension/packages.config deleted file mode 100644 index 54a81e0..0000000 --- a/src/SampleExtension/packages.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SampleIntegration/SampleIntegration.csproj b/src/SampleIntegration/SampleIntegration.csproj index fc4e073..e8d5ac6 100644 --- a/src/SampleIntegration/SampleIntegration.csproj +++ b/src/SampleIntegration/SampleIntegration.csproj @@ -1,60 +1,12 @@ - - - + + + + - Debug - AnyCPU - {5C06327E-B4AE-4909-AA0F-A0491A424BF0} - Library - Properties SampleIntegration SampleIntegration - v4.0 - 512 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - {ef879a10-041d-4c68-83e7-3192685f1bae} - DynamoServices - + - - \ No newline at end of file diff --git a/src/SampleIntegration/TracedHog.cs b/src/SampleIntegration/TracedHog.cs index 217ec40..424fa88 100644 --- a/src/SampleIntegration/TracedHog.cs +++ b/src/SampleIntegration/TracedHog.cs @@ -3,8 +3,9 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; - +using Dynamo.Events; using DynamoServices; +using Newtonsoft.Json; class TracedHogManager { @@ -69,8 +70,6 @@ public HogID(SerializationInfo info, StreamingContext context) } } - -[RegisterForTrace] public class TracedHog : IDisposable { //TODO(lukechurch): This really should have been moved into the attribute already @@ -107,7 +106,7 @@ public static TracedHog ByPoint(double x, double y) { TracedHog tHog; - HogID hid = TraceUtils.GetTraceData(REVIT_TRACE_ID) as HogID; + HogID hid = JsonConvert.DeserializeObject(TraceUtils.GetTraceData(REVIT_TRACE_ID)); if (hid == null) { @@ -120,7 +119,7 @@ public static TracedHog ByPoint(double x, double y) } // Set the trace data on the return to be this hog. - TraceUtils.SetTraceData(REVIT_TRACE_ID, new HogID { IntID = tHog.ID }); + TraceUtils.SetTraceData(REVIT_TRACE_ID, JsonConvert.SerializeObject(new HogID { IntID = tHog.ID })); return tHog; } diff --git a/src/SampleLibraryTests/HelloDynamoSystemTests.cs b/src/SampleLibraryTests/HelloDynamoSystemTests.cs index d037dbc..9a00579 100644 --- a/src/SampleLibraryTests/HelloDynamoSystemTests.cs +++ b/src/SampleLibraryTests/HelloDynamoSystemTests.cs @@ -49,7 +49,7 @@ protected override void GetLibrariesToPreload(List libraries) // The RequiresSTA attribute is required by // NUNit to run tests that use the UI. - [Test, RequiresSTA] + [Test, Apartment(System.Threading.ApartmentState.STA)] public void HelloDynamoTest() { // HelloWorldSystemTest.dyn is a test .dyn file which diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index 277ff93..b4c12e0 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -1,161 +1,21 @@ - - - + - + Debug - AnyCPU - {933B8108-4E74-470A-86C7-4B7F633115B9} - Library - Properties SampleLibraryTests SampleLibraryTests - v4.8 - 512 - + + net8.0-windows + true - - true - full - false - ..\..\..\Dynamo\bin\AnyCPU\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - - ..\packages\DynamoVisualProgramming.Tests.2.12.0-beta4933\lib\net48\DynamoCoreTests.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - - ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll - False - - - False - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll - False - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll - False - - - ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - False - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - False - - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll - - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - ..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll - - - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll - False - - - - ..\packages\DynamoVisualProgramming.Tests.2.12.0-beta4933\lib\net48\SystemTestServices.dll - - - ..\packages\DynamoVisualProgramming.Tests.2.12.0-beta4933\lib\net48\TestServices.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll - - - - - - AssemblySharedInfo.cs - - - - - - PreserveNewest - - - PreserveNewest - - - - - - + + + \ No newline at end of file diff --git a/src/SampleLibraryTests/Setup.cs b/src/SampleLibraryTests/Setup.cs new file mode 100644 index 0000000..c787f75 --- /dev/null +++ b/src/SampleLibraryTests/Setup.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Globalization; +using System.IO; +using System.Reflection; +using NUnit.Framework; + + +[SetUpFixture] +public class Setup +{ + private string moduleRootFolder; + List resolutionPaths; + + [OneTimeSetUp] + public void RunBeforeAllTests() + { + var thisDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + var configPath = Path.Combine(thisDir, "TestServices.dll.config"); + + // Adjust the config file map because the config file + // might not always be in the same directory as the dll. + var map = new ExeConfigurationFileMap { ExeConfigFilename = configPath }; + var config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None); + + var element = config.AppSettings.Settings["DynamoBasePath"]; + moduleRootFolder = element?.Value ?? string.Empty; + + if (string.IsNullOrEmpty(moduleRootFolder)) + { + throw new Exception("Missing DynamoBasePath in TestServices.dll.config. Please set the DynamoBasePath to a valid Dynamo bin folder."); + } + else if (!File.Exists(Path.Combine(moduleRootFolder, "DynamoCore.dll"))) + { + throw new Exception("Invalid DynamoBasePath in TestServices.dll.config. Please set the DynamoBasePath to a valid Dynamo bin folder."); + } + + resolutionPaths = new List + { + // Search for nodes + Path.Combine(moduleRootFolder, "nodes") + }; + AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; ; + } + + private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) + { + try + { + var targetAssemblyName = new AssemblyName(args.Name).Name + ".dll"; + + // First check the core path + string assemblyPath = Path.Combine(moduleRootFolder, targetAssemblyName); + if (File.Exists(assemblyPath)) + { + return Assembly.LoadFrom(assemblyPath); + } + + // Then check all additional resolution paths + foreach (var resolutionPath in resolutionPaths) + { + assemblyPath = Path.Combine(resolutionPath, targetAssemblyName); + if (File.Exists(assemblyPath)) + { + return Assembly.LoadFrom(assemblyPath); + } + } + + return null; + } + catch (Exception ex) + { + throw new Exception(string.Format("There location of the assembly, " + + "{0} could not be resolved for loading.", args.Name), ex); + } + } + + [OneTimeTearDown] + public void RunAfterAllTests() + { + AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve; + } +} diff --git a/src/SampleLibraryTests/TestServices.dll.config b/src/SampleLibraryTests/TestServices.dll.config deleted file mode 100644 index 2aa3715..0000000 --- a/src/SampleLibraryTests/TestServices.dll.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/SampleLibraryTests/app.config b/src/SampleLibraryTests/app.config deleted file mode 100644 index 34a6e87..0000000 --- a/src/SampleLibraryTests/app.config +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SampleLibraryTests/packages.config b/src/SampleLibraryTests/packages.config deleted file mode 100644 index 7ff169d..0000000 --- a/src/SampleLibraryTests/packages.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SampleLibraryUI/SampleLibraryUI.csproj b/src/SampleLibraryUI/SampleLibraryUI.csproj index de71af6..229eba6 100644 --- a/src/SampleLibraryUI/SampleLibraryUI.csproj +++ b/src/SampleLibraryUI/SampleLibraryUI.csproj @@ -1,194 +1,18 @@ - - - + - + - en-US - - - Debug - AnyCPU - {0A4B4EEA-8FAB-4AC8-90D4-27DBC5B0CF2A} - Library - Properties SampleLibraryUI SampleLibraryUI - v4.8 - 512 - - - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 4 - bin\Debug\$(UICulture)\SampleLibraryUI.XML - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\$(UICulture)\SampleLibraryUI.XML - false + + net8.0-windows + true + + + true + bin\$(Configuration)\$(UICulture)\SampleLibraryUI.XML - - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModels.dll - - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModelsWpf.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\DynamoCoreWpf.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - - ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll - False - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll - False - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll - False - - - ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - False - - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll - - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - ..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll - - - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll - False - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll - - - - - - AssemblySharedInfo.cs - - - ButtonControl.xaml - - - SliderControl.xaml - - - - - - - - True - True - Resources.resx - - - True - True - Resources.en-US.resx - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - PublicResXFileCodeGenerator - Resources.en-US.Designer.cs - - - - - - {bd13c4dc-9045-4e49-b637-b6182b0e3a7f} @@ -199,20 +23,14 @@ - - - - - - - - - - - - + + + + + + - + diff --git a/src/SampleLibraryUI/app.config b/src/SampleLibraryUI/app.config deleted file mode 100644 index 7ba3765..0000000 --- a/src/SampleLibraryUI/app.config +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SampleLibraryUI/packages.config b/src/SampleLibraryUI/packages.config deleted file mode 100644 index 54a81e0..0000000 --- a/src/SampleLibraryUI/packages.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SampleLibraryZeroTouch/Examples/BasicExample.cs b/src/SampleLibraryZeroTouch/Examples/BasicExample.cs index 5229eb5..f26cd38 100644 --- a/src/SampleLibraryZeroTouch/Examples/BasicExample.cs +++ b/src/SampleLibraryZeroTouch/Examples/BasicExample.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Runtime.Remoting.Metadata.W3cXsd2001; using Autodesk.DesignScript.Geometry; using Autodesk.DesignScript.Interfaces; using Autodesk.DesignScript.Runtime; diff --git a/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs b/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs index aef5c51..4458e08 100644 --- a/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs +++ b/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs @@ -12,7 +12,7 @@ namespace Examples // requires a parameter, 't', that is incremented during each run. // This example also demonstrates how to use trace to store data that // you want to carry over between evaluations. - public class PeriodicUpdateExample : IGraphicItem + public class PeriodicUpdateExample : IGraphicItem { private Point[,] vertexCoords; private const int width = 20; @@ -32,7 +32,7 @@ private PeriodicUpdateExample(double t, int id) } t += 0.1; - if (t > Math.PI*2) t = 0.0; + if (t > Math.PI * 2) t = 0.0; // Remember to store the updated object in the trace object manager, // so it's available to use the next time around. @@ -78,8 +78,8 @@ public void Tessellate(IRenderPackage package, TessellationParameters parameters { for (var j = 0; j < length - 1; j++) { - var a = vertexCoords[i , j]; - var b = vertexCoords[i , j + 1]; + var a = vertexCoords[i, j]; + var b = vertexCoords[i, j + 1]; var c = vertexCoords[i + 1, j]; var d = vertexCoords[i + 1, j + 1]; @@ -101,8 +101,8 @@ private void PushTriangleVertex(IRenderPackage package, Point p, Vector n) { package.AddTriangleVertex(p.X, p.Y, p.Z); package.AddTriangleVertexColor(255, 255, 255, 255); - package.AddTriangleVertexNormal(n.X,n.Y,n.Z); - package.AddTriangleVertexUV(0,0); + package.AddTriangleVertexNormal(n.X, n.Y, n.Z); + package.AddTriangleVertexUV(0, 0); } } -} +} \ No newline at end of file diff --git a/src/SampleLibraryZeroTouch/Examples/TraceExample.cs b/src/SampleLibraryZeroTouch/Examples/TraceExample.cs index 600dee4..f705765 100644 --- a/src/SampleLibraryZeroTouch/Examples/TraceExample.cs +++ b/src/SampleLibraryZeroTouch/Examples/TraceExample.cs @@ -3,6 +3,7 @@ using System.Runtime.Serialization; using Autodesk.DesignScript.Runtime; using DynamoServices; +using Newtonsoft.Json; namespace Examples { @@ -115,7 +116,7 @@ public static int GetNextUnusedID() public static TraceableId GetObjectIdFromTrace() { - return TraceUtils.GetTraceData(REVIT_TRACE_ID) as TraceableId; + return JsonConvert.DeserializeObject(TraceUtils.GetTraceData(REVIT_TRACE_ID)); } public static object GetTracedObjectById(int id) @@ -134,7 +135,8 @@ public static void RegisterTraceableObjectForId(int id, object objectToTrace) else { traceableObjectManager.Add(id, objectToTrace); - TraceUtils.SetTraceData(REVIT_TRACE_ID, new TraceableId(id)); + + TraceUtils.SetTraceData(REVIT_TRACE_ID, JsonConvert.SerializeObject(objectToTrace)); } } @@ -171,4 +173,4 @@ public TraceableId(SerializationInfo info, StreamingContext context) IntID = (int)info.GetValue("intID", typeof(int)); } } -} +} \ No newline at end of file diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index 343295e..f18e7c4 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -1,163 +1,23 @@ - - - + - + - Debug - AnyCPU - {BD13C4DC-9045-4E49-B637-B6182B0E3A7F} - Library Properties SampleLibraryZeroTouch SampleLibraryZeroTouch - v4.8 - 512 - + + + true + bin\$(Configuration)\SampleLibraryZeroTouch.XML - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\SampleLibraryZeroTouch.XML - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\SampleLibraryZeroTouch.XML - false - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - - ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll - True - False - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll - False - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll - False - - - ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - False - - - False - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll - - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - ..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll - - - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll - True - False - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll - - - - - - AssemblySharedInfo.cs - - - - - - - - - - - + + + - - - - - - - - - - - - + + diff --git a/src/SampleLibraryZeroTouch/packages.config b/src/SampleLibraryZeroTouch/packages.config deleted file mode 100644 index c66068e..0000000 --- a/src/SampleLibraryZeroTouch/packages.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SampleLinter/SampleLinter.csproj b/src/SampleLinter/SampleLinter.csproj index d0dd566..bb592fc 100644 --- a/src/SampleLinter/SampleLinter.csproj +++ b/src/SampleLinter/SampleLinter.csproj @@ -1,82 +1,40 @@  + + + - {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8} - net48 SampleLinter SampleLinter Copyright © 2023 2.0.1.0 2.0.1.0 + + + true bin\$(Configuration)\ - - full - - - pdbonly - - - - - - - - - - - - - - - - Runtime - - - - - Runtime - - - - - Runtime - - - - - Runtime - - - - - Runtime - - - - - Always - - - - - True - True - Resources.resx - - - - - - - - PublicResXFileCodeGenerator - Resources.Designer.cs - + + + Always + + Always + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SampleLinter/app.config b/src/SampleLinter/app.config deleted file mode 100644 index 0150915..0000000 --- a/src/SampleLinter/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/SampleViewExtension/SampleViewExtension.csproj b/src/SampleViewExtension/SampleViewExtension.csproj index 101eb58..a2b6881 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -1,171 +1,25 @@ - - - + - + - Debug - AnyCPU - {146EBF48-E7A0-4ABE-809D-D7F3059E4EE1} - Library - Properties SampleViewExtension SampleViewExtension - v4.8 - 512 - + + net8.0-windows + true - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModels.dll - - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\CoreNodeModelsWpf.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DesignScriptBuiltin.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSCPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DSIronPython.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoApplications.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoCore.dll - - - ..\packages\DynamoVisualProgramming.WpfUILibrary.2.12.0-beta4933\lib\net48\DynamoCoreWpf.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoInstallDetective.dll - - - ..\packages\DynamoVisualProgramming.DynamoServices.2.12.0-beta4933\lib\net48\DynamoServices.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoShapeManager.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\DynamoUnits.dll - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\DynamoUtilities.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Expression.Interactions.dll - True - False - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.dll - False - - - ..\packages\Prism.4.1.0.0\lib\NET40\Microsoft.Practices.Prism.Interactivity.dll - False - - - ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - True - False - - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\ProtoCore.dll - - - ..\packages\DynamoVisualProgramming.ZeroTouchLibrary.2.12.0-beta4933\lib\net48\ProtoGeometry.dll - - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - ..\packages\System.Collections.Immutable.1.7.1\lib\net461\System.Collections.Immutable.dll - - - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\Prism.4.1.0.0\lib\NET40\System.Windows.Interactivity.dll - True - False - - - - - - - - - - ..\packages\DynamoVisualProgramming.Core.2.12.0-beta4933\lib\net48\VMDataBridge.dll - - - - - - - SampleWindow.xaml - - + + + - - Designer - MSBuild:Compile - - - - - + Always - - - - - + - - + @@ -173,11 +27,4 @@ - \ No newline at end of file diff --git a/src/SampleViewExtension/app.config b/src/SampleViewExtension/app.config deleted file mode 100644 index f5bdb8b..0000000 --- a/src/SampleViewExtension/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/SampleViewExtension/packages.config b/src/SampleViewExtension/packages.config deleted file mode 100644 index 54a81e0..0000000 --- a/src/SampleViewExtension/packages.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file From 25791ca2e4e4a18aec6c778945b95d973b0eaa06 Mon Sep 17 00:00:00 2001 From: Aabishkar KC Date: Thu, 18 Jan 2024 15:26:03 -0500 Subject: [PATCH 13/27] Update build workflow (#51) --- .github/workflows/build.yml | 61 ++++++++++++++++++ .../workflows/build_dynamo_samples_net8.0.yml | 62 ------------------- LICENSE | 3 +- README.md | 9 ++- 4 files changed, 68 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/build_dynamo_samples_net8.0.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6244a8b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,61 @@ +# Build SampleIntegration.sln and DynamoSamples.sln with .NET 8.0 +name: Build + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout DynamoSamples Repo + uses: actions/checkout@v4 + with: + path: DynamoSamples + repository: DynamoDS/DynamoSamples + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + - name: Disable problem matcher + run: echo "::remove-matcher owner=csc::" + - name: Setup msbuild + uses: microsoft/setup-msbuild@v1.3 + - name: Install dependencies for SampleIntegration + run: | + dotnet restore ${{ github.workspace }}\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release --runtime=win-x64 + - name: Build SampleIntegration + run: | + msbuild ${{ github.workspace }}\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release + - name: Look for Sample Integration + run: | + if (Test-Path -Path "${{ github.workspace }}\DynamoSamples\src\SampleIntegration\bin\Release\SampleIntegration.dll") { + Write-Output "SampleIntegration.dll exists!" + } else { + Write-Error "SampleIntegration.dll was not found!" + } + - name: Install dependencies for DynamoSamples + run: | + dotnet restore ${{ github.workspace }}\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release --runtime=win-x64 + - name: Build DynamoSamples + run: | + msbuild ${{ github.workspace }}\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release + - name: Look for Sample Packages + run: | + $paths = @( + "${{ github.workspace }}\DynamoSamples\dynamo_linter\Sample Linter\bin\SampleLinter.dll", + "${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleLibraryUI.dll", + "${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleLibraryZeroTouch.dll", + "${{ github.workspace }}\DynamoSamples\dynamo_viewExtension\Sample View Extension\bin\SampleViewExtension.dll" + ) + + foreach ($path in $paths) { + if (Test-Path -Path $path) { + Write-Output "$path exists!" + } else { + Write-Error "$path was not found!" + } + } diff --git a/.github/workflows/build_dynamo_samples_net8.0.yml b/.github/workflows/build_dynamo_samples_net8.0.yml deleted file mode 100644 index 1d35049..0000000 --- a/.github/workflows/build_dynamo_samples_net8.0.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Build DynamoAll.sln with .NET 8.0 -name: Build DynamoSamples.sln net8.0 - -on: - push: - branches: - - master - pull_request: - -jobs: - build: - runs-on: windows-latest - steps: - - name: Checkout DynamoSamples Repo - uses: actions/checkout@v4 - with: - path: DynamoSamples - repository: DynamoDS/DynamoSamples - - name: Setup dotnet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' - - name: Disable problem matcher - run: echo "::remove-matcher owner=csc::" - - name: Install dependencies for SampleIntegration - run: | - dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release --runtime=win-x64 - - name: Build SampleIntegration with MSBuild for Windows - run: | - echo "***Continue with the build, Good luck developer!***" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\" - .\MSBuild.exe $Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release - # look for DynamoSamples outputs - - name: Navigate to SampleIntegration Folder - run: | - cd "$Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\bin\Release" - echo "***Locating SampleIntegration.dll for Windows!***" - test ".\SampleIntegration.dll" && echo "SampleIntegration.dll exists!" - - name: Install dependencies for windows runtime - run: | - dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release --runtime=win-x64 - - name: Build DynamoSamples with MSBuild for Windows - run: | - echo "***Continue with the build, Good luck developer!***" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\" - .\MSBuild.exe $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release - # look for DynamoSamples outputs - - name: Navigate to dynamo_linter Folder - run: | - cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_linter\Sample Linter\bin" - echo "***Locating SampleLinter.dll for Windows!***" - test ".\SampleLinter.dll" && echo "SampleLinter.dll exists!" - - name: Navigate to dynamo_package Folder - run: | - cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_package\Dynamo Samples\bin" - echo "***Locating dynamo_package dlls for Windows!***" - test ".\SampleLibraryUI.dll" && echo "SampleLibraryUI.dll exists!" && test ".\SampleLibraryZeroTouch.dll" && echo "SampleLibraryZeroTouch.dll exists!" - - name: Navigate to dynamo_viewExtension Folder - run: | - cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_viewExtension\Sample View Extension\bin" - echo "***Locating SampleViewExtension.dll for Windows!***" - test ".\SampleViewExtension.dll" && echo "SampleViewExtension.dll exists!" diff --git a/LICENSE b/LICENSE index 20efd1b..fb69acf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 +Copyright (c) 2024 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/README.md b/README.md index 716f7e8..53050cc 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,25 @@ -[![Build status](https://ci.appveyor.com/api/projects/status/qjdj92r86xb2tbq3?svg=true)](https://ci.appveyor.com/project/ikeough/dynamosamples) +[![Build](https://github.com/DynamoDS/DynamoSamples/actions/workflows/build.yml/badge.svg)](https://github.com/DynamoDS/DynamoSamples/actions/workflows/build.yml) ![Image](https://raw.github.com/ikeough/Dynamo/master/doc/distrib/Images/dynamo_logo_dark.png) # Dynamo Samples + A collection of samples demonstrating how to develop libraries for Dynamo. -These samples make use of the [Dynamo NuGet packages](https://www.nuget.org/packages?q=DynamoVisualProgramming). NuGet should take care of restoring these packages if they are not available on your system at build time. +These samples make use of the [Dynamo NuGet packages](https://www.nuget.org/packages?q=DynamoVisualProgramming). NuGet should take care of restoring these packages if they are not available on your system at build time. # Building the Samples ## Requirements + - Visual Studio 2019 - .NET Framework 4.8 ## Instructions + - Clone the repository. - Choose a branch: - - The master branch of Dynamo Samples corresponds to the master branch of Dynamo. To build against a specific version, choose that version's branch. I.e. 0.8.0, 0.9.0, etc. + - The master branch of Dynamo Samples corresponds to the master branch of Dynamo. To build against a specific version, choose that version's branch. i.e. 0.8.0, 0.9.0, etc. - Open `DynamoSamples.sln` with Visual Studio. - Build using the `Debug/Any CPU` configuration. - The `dynamo_package` folder at the root of the repository will now have the built libraries. The `Dynamo Samples` folder in that directory can be copied directly to your Dynamo packages directory:`C:\Users\\AppData\Roaming\Dynamo Core\\packages`. From df9e1b0354092e39e80fef7e53d195417a57b2b0 Mon Sep 17 00:00:00 2001 From: pinzart90 <46732933+pinzart90@users.noreply.github.com> Date: Wed, 7 Feb 2024 09:29:07 -0500 Subject: [PATCH 14/27] add units example (#52) * add units example * Update build.yml --- .github/workflows/build.yml | 1 + src/DynamoSamples.sln | 16 ++- src/SampleZeroTouchUnits/RectangleExample.cs | 132 ++++++++++++++++++ .../SampleZeroTouchUnits.csproj | 26 ++++ 4 files changed, 170 insertions(+), 5 deletions(-) create mode 100644 src/SampleZeroTouchUnits/RectangleExample.cs create mode 100644 src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6244a8b..3748c0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,6 +49,7 @@ jobs: "${{ github.workspace }}\DynamoSamples\dynamo_linter\Sample Linter\bin\SampleLinter.dll", "${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleLibraryUI.dll", "${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleLibraryZeroTouch.dll", + "${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleZeroTouchUnits.dll", "${{ github.workspace }}\DynamoSamples\dynamo_viewExtension\Sample View Extension\bin\SampleViewExtension.dll" ) diff --git a/src/DynamoSamples.sln b/src/DynamoSamples.sln index a9a1d9a..cdd718b 100644 --- a/src/DynamoSamples.sln +++ b/src/DynamoSamples.sln @@ -3,18 +3,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.6.33815.320 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleLibraryTests", "SampleLibraryTests\SampleLibraryTests.csproj", "{933B8108-4E74-470A-86C7-4B7F633115B9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleLibraryTests", "SampleLibraryTests\SampleLibraryTests.csproj", "{933B8108-4E74-470A-86C7-4B7F633115B9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleLibraryUI", "SampleLibraryUI\SampleLibraryUI.csproj", "{0A4B4EEA-8FAB-4AC8-90D4-27DBC5B0CF2A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleLibraryUI", "SampleLibraryUI\SampleLibraryUI.csproj", "{0A4B4EEA-8FAB-4AC8-90D4-27DBC5B0CF2A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleLibraryZeroTouch", "SampleLibraryZeroTouch\SampleLibraryZeroTouch.csproj", "{BD13C4DC-9045-4E49-B637-B6182B0E3A7F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleLibraryZeroTouch", "SampleLibraryZeroTouch\SampleLibraryZeroTouch.csproj", "{BD13C4DC-9045-4E49-B637-B6182B0E3A7F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleViewExtension", "SampleViewExtension\SampleViewExtension.csproj", "{146EBF48-E7A0-4ABE-809D-D7F3059E4EE1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleViewExtension", "SampleViewExtension\SampleViewExtension.csproj", "{146EBF48-E7A0-4ABE-809D-D7F3059E4EE1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtension", "SampleExtension\SampleExtension.csproj", "{8B27B070-8434-49C8-8D43-41A4AE53BC36}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleExtension", "SampleExtension\SampleExtension.csproj", "{8B27B070-8434-49C8-8D43-41A4AE53BC36}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleLinter", "SampleLinter\SampleLinter.csproj", "{5F559FDB-99B9-4F4A-9A91-C9EC94C771D8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleZeroTouchUnits", "SampleZeroTouchUnits\SampleZeroTouchUnits.csproj", "{4F9ECB35-D321-482A-8ED4-CC8E9342AACE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +47,10 @@ Global {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8}.Debug|Any CPU.Build.0 = Debug|Any CPU {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8}.Release|Any CPU.ActiveCfg = Release|Any CPU {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8}.Release|Any CPU.Build.0 = Release|Any CPU + {4F9ECB35-D321-482A-8ED4-CC8E9342AACE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F9ECB35-D321-482A-8ED4-CC8E9342AACE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F9ECB35-D321-482A-8ED4-CC8E9342AACE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F9ECB35-D321-482A-8ED4-CC8E9342AACE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/SampleZeroTouchUnits/RectangleExample.cs b/src/SampleZeroTouchUnits/RectangleExample.cs new file mode 100644 index 0000000..a7be5fb --- /dev/null +++ b/src/SampleZeroTouchUnits/RectangleExample.cs @@ -0,0 +1,132 @@ +using Autodesk.DesignScript.Interfaces; +using Autodesk.DesignScript.Runtime; +using System.Collections.Generic; +using System; +using DynamoUnits; +using Dynamo.Graph.Nodes.CustomNodes; + +namespace SampleZeroTouchUnits +{ + /// + /// The RectangleExample class demonstrates + /// how to use the Dynamo Units API to convert between units. + /// + public class RectangleExample + { + const string meters = "autodesk.unit.unit:meters"; + const string meters2 = "autodesk.unit.unit:squareMeters"; + + /// + /// The Length value + /// + private readonly double Length; + + /// + /// The Width value + /// + private readonly double Width; + + private Unit LengthUnit; + private Unit WidthUnit; + private Unit AreaUnit; + + /// + /// + /// + /// + /// + public RectangleExample(double width, double length) + { + Length = length; + Width = width; + LengthUnit = Unit.ByTypeID($"{meters}-1.0.1"); + WidthUnit = Unit.ByTypeID($"{meters}-1.0.1"); + AreaUnit = Unit.ByTypeID($"{meters2}-1.0.1"); + } + + /// + /// + /// + /// + /// + /// + /// + public RectangleExample(double width, double length, Unit widthUnit, Unit lengthUnit) + { + Width = width; + Length = length; + + LengthUnit = lengthUnit; + WidthUnit = widthUnit; + + AreaUnit = Unit.ByTypeID($"{meters2}-1.0.1"); + } + + /// + /// + /// + /// + /// + /// + public double GetLength(Unit targetUnit = null) + { + targetUnit ??= LengthUnit; + ArgumentNullException.ThrowIfNull(targetUnit); + + if (!Unit.AreUnitsConvertible(LengthUnit, targetUnit)) + { + throw new ArgumentException($"{LengthUnit} is not convertible to {targetUnit}"); + } + + var output = Utilities.ConvertByUnits(Length, LengthUnit, targetUnit); + return output; + } + + /// + /// + /// + /// + /// + /// + public double GetWidth(Unit targetUnit) + { + targetUnit ??= WidthUnit; + ArgumentNullException.ThrowIfNull(targetUnit); + if (!Unit.AreUnitsConvertible(WidthUnit, targetUnit)) + { + throw new ArgumentException($"{LengthUnit} is not convertible to {targetUnit}"); + } + + var output = Utilities.ConvertByUnits(Length, WidthUnit, targetUnit); + return output; + } + + string GetFirstSymbolText(Unit unit) + { + var symbols = DynamoUnits.Symbol.SymbolsByUnit(unit); + foreach (var symbol in symbols) + { + return symbol.Text; + } + return string.Empty; + } + + /// + /// + /// + /// + /// + /// + public string GetArea(Unit targetUnit = null) + { + targetUnit ??= AreaUnit; + if (!Unit.AreUnitsConvertible(AreaUnit, targetUnit)) + { + throw new ArgumentException($"{targetUnit.Name} is not a valid area unit"); + } + + double area = Utilities.ParseExpressionByUnit(targetUnit, $"{Length}{GetFirstSymbolText(LengthUnit)} * {Width}{GetFirstSymbolText(WidthUnit)}"); + return $"{area}{GetFirstSymbolText(targetUnit)}"; + } + } +} diff --git a/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj b/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj new file mode 100644 index 0000000..b739b86 --- /dev/null +++ b/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj @@ -0,0 +1,26 @@ + + + + + + Properties + SampleZeroTouchUnits + SampleZeroTouchUnits + + + true + bin\$(Configuration)\SampleZeroTouchUnits.XML + + + + + + + + + + + + + + \ No newline at end of file From 75e73b8d5cee51053caaaa10960f3baae7121ddc Mon Sep 17 00:00:00 2001 From: pinzart90 <46732933+pinzart90@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:45:27 -0500 Subject: [PATCH 15/27] add tests (#53) * add tests * update * Update SampleIntegration.csproj * update * Update build.yml * do not run asm tests * update --- .github/workflows/build.yml | 23 + src/Config/CS.props | 1 - src/Directory.Build.props | 10 + src/SampleExtension/SampleExtension.csproj | 3 +- .../SampleIntegration.csproj | 1 + .../HelloDynamoSystemTest.dyn | 253 ++++++- .../HelloDynamoZeroTouchTests.cs | 2 + .../Properties/AssemblyInfo.cs | 9 +- .../RectangleUnitsExample.dyn | 616 ++++++++++++++++++ .../SampleLibraryTests.csproj | 11 +- .../TestServices.dll.config | 7 + .../ZeroTouchUnitsSystemTests.cs | 80 +++ src/SampleLibraryUI/SampleLibraryUI.csproj | 6 +- .../SampleLibraryZeroTouch.csproj | 7 +- src/SampleLinter/SampleLinter.csproj | 7 +- .../SampleViewExtension.csproj | 6 +- src/SampleZeroTouchUnits/RectangleExample.cs | 32 +- .../SampleZeroTouchUnits.csproj | 7 +- 18 files changed, 1026 insertions(+), 55 deletions(-) create mode 100644 src/Directory.Build.props create mode 100644 src/SampleLibraryTests/RectangleUnitsExample.dyn create mode 100644 src/SampleLibraryTests/TestServices.dll.config create mode 100644 src/SampleLibraryTests/ZeroTouchUnitsSystemTests.cs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3748c0a..d1e6f1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,3 +60,26 @@ jobs: Write-Error "$path was not found!" } } + - name: Get DynamoRuntime from s3 + run: | + curl -o DynamoRuntime.zip https://dyn-builds-data.s3-us-west-2.amazonaws.com/DynamoCoreRuntime_3.1.0.4081_20240212T2057.zip + ls + - name: Extract DynamoRuntime + run: | + 7z x DynamoRuntime.zip -o${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests\bin\Release\DynamoRuntime + + - name: Run test with the dotnet CLI + run: | + dotnet test ${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests -p:Configuration=Release --filter "TestCategory!=Failure&TestCategory!=NEEDS_GEOM_LIB" --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DynamoSamples\TestResults + - name: Upload build artifact + uses: actions/upload-artifact@v3.1.3 + with: + name: DynamoSamples + path: ${{ github.workspace }}\DynamoSamples\dynamo_package + retention-days: 7 + - name: Upload test artifact + uses: actions/upload-artifact@v3.1.3 + with: + name: TestResults + path: ${{ github.workspace }}\DynamoSamples\TestResults + retention-days: 1 \ No newline at end of file diff --git a/src/Config/CS.props b/src/Config/CS.props index 07ee8e9..cc62aa7 100644 --- a/src/Config/CS.props +++ b/src/Config/CS.props @@ -3,7 +3,6 @@ Debug AnyCPU x64 - net8.0 512 false false diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..daf5058 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,10 @@ + + + + $(MSBuildThisFileDirectory)\ + + diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index fb4c133..249af7b 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -6,6 +6,7 @@ Debug SampleExtension SampleExtension + net8.0 true @@ -16,6 +17,6 @@ - + \ No newline at end of file diff --git a/src/SampleIntegration/SampleIntegration.csproj b/src/SampleIntegration/SampleIntegration.csproj index e8d5ac6..9c549c7 100644 --- a/src/SampleIntegration/SampleIntegration.csproj +++ b/src/SampleIntegration/SampleIntegration.csproj @@ -5,6 +5,7 @@ SampleIntegration SampleIntegration + net8.0 diff --git a/src/SampleLibraryTests/HelloDynamoSystemTest.dyn b/src/SampleLibraryTests/HelloDynamoSystemTest.dyn index 555ce32..11bd319 100644 --- a/src/SampleLibraryTests/HelloDynamoSystemTest.dyn +++ b/src/SampleLibraryTests/HelloDynamoSystemTest.dyn @@ -1,18 +1,235 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file +{ + "Uuid": "3c9d0464-8643-5ffe-96e5-ab1769818209", + "IsCustomNode": false, + "Description": "", + "Name": "HelloDynamoSystemTest", + "ElementResolver": { + "ResolutionMap": {} + }, + "Inputs": [], + "Outputs": [], + "Nodes": [ + { + "ConcreteType": "CoreNodeModels.Watch, CoreNodeModels", + "WatchWidth": 35.0, + "WatchHeight": 38.0, + "Id": "2c4cdf29f078497c86b8fed323f4b77d", + "NodeType": "ExtensionNode", + "Inputs": [ + { + "Id": "a249fef4a4ce43ed9fa47a4ace364c8c", + "Name": "", + "Description": "Node to show output from", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "6bb8cd0394254f268082f176f97a233a", + "Name": "", + "Description": "Node output", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Visualizes a node's output" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "Id": "4964a3edb14b46dd8e614d64fad42128", + "NodeType": "FunctionNode", + "Inputs": [ + { + "Id": "2e564722e153444292ce3cf2fd1ea4df", + "Name": "x", + "Description": "Integer value, double value or string\n\nvar[]..[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "c878418229554a8081a2add69a669b4c", + "Name": "y", + "Description": "Integer value, double value or string\n\nvar[]..[]", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "f648d8c8b1b7407eb51174f21f2d4908", + "Name": "var", + "Description": "The sum of two input numbers, or the concatenation of two strings", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "FunctionSignature": "+@var[]..[],var[]..[]", + "Replication": "Auto", + "Description": "Returns addition of x and y\n\n+ (x: var[]..[], y: var[]..[]): var[]..[]" + }, + { + "ConcreteType": "CoreNodeModels.Input.DoubleInput, CoreNodeModels", + "NumberType": "Double", + "Id": "77af56fb6e37432485e008870d79cb40", + "NodeType": "NumberInputNode", + "Inputs": [], + "Outputs": [ + { + "Id": "982234929f014a7dacf16d38836763a1", + "Name": "", + "Description": "Double", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Creates a number", + "InputValue": 21.0 + }, + { + "ConcreteType": "CoreNodeModels.Input.DoubleInput, CoreNodeModels", + "NumberType": "Double", + "Id": "a603bf1480404297bea85441d71645ed", + "NodeType": "NumberInputNode", + "Inputs": [], + "Outputs": [ + { + "Id": "e57dc497431840b98db808aca08d846b", + "Name": "", + "Description": "Double", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Creates a number", + "InputValue": 21.0 + } + ], + "Connectors": [ + { + "Start": "f648d8c8b1b7407eb51174f21f2d4908", + "End": "a249fef4a4ce43ed9fa47a4ace364c8c", + "Id": "b47128bfe4304b74a01f7b8db90d2c34", + "IsHidden": "False" + }, + { + "Start": "982234929f014a7dacf16d38836763a1", + "End": "2e564722e153444292ce3cf2fd1ea4df", + "Id": "73b3eba3b10e4b1f86c836c5164e01e9", + "IsHidden": "False" + }, + { + "Start": "e57dc497431840b98db808aca08d846b", + "End": "c878418229554a8081a2add69a669b4c", + "Id": "0ebc660b634b4281814460827fd4fa78", + "IsHidden": "False" + } + ], + "Dependencies": [], + "NodeLibraryDependencies": [], + "EnableLegacyPolyCurveBehavior": null, + "Thumbnail": null, + "GraphDocumentationURL": null, + "ExtensionWorkspaceData": [ + { + "ExtensionGuid": "28992e1d-abb9-417f-8b1b-05e053bee670", + "Name": "Properties", + "Version": "3.1", + "Data": {} + } + ], + "Author": "None provided", + "Linting": { + "activeLinter": "None", + "activeLinterId": "7b75fb44-43fd-4631-a878-29f4d5d8399a", + "warningCount": 0, + "errorCount": 0 + }, + "Bindings": [], + "View": { + "Dynamo": { + "ScaleFactor": 1.0, + "HasRunWithoutCrash": true, + "IsVisibleInDynamoLibrary": true, + "Version": "3.1.0.3755", + "RunType": "Manual", + "RunPeriod": "1000" + }, + "Camera": { + "Name": "_Background Preview", + "EyeX": -17.0, + "EyeY": 24.0, + "EyeZ": 50.0, + "LookX": 12.0, + "LookY": -13.0, + "LookZ": -58.0, + "UpX": 0.0, + "UpY": 1.0, + "UpZ": 0.0 + }, + "ConnectorPins": [], + "NodeViews": [ + { + "Id": "2c4cdf29f078497c86b8fed323f4b77d", + "Name": "Watch", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 613.408069206988, + "Y": 243.832684826672 + }, + { + "Id": "4964a3edb14b46dd8e614d64fad42128", + "Name": "+", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 404.715400784895, + "Y": 238.891755796865 + }, + { + "Id": "77af56fb6e37432485e008870d79cb40", + "Name": "Number", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 159.40168436709547, + "Y": 106.14571181066069 + }, + { + "Id": "a603bf1480404297bea85441d71645ed", + "Name": "Number", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 157.2343691937667, + "Y": 282.8144436335819 + } + ], + "Annotations": [], + "X": 146.89726815586, + "Y": 9.96610837046791, + "Zoom": 1.05281788169755 + } +} \ No newline at end of file diff --git a/src/SampleLibraryTests/HelloDynamoZeroTouchTests.cs b/src/SampleLibraryTests/HelloDynamoZeroTouchTests.cs index 3332288..9fcbd12 100644 --- a/src/SampleLibraryTests/HelloDynamoZeroTouchTests.cs +++ b/src/SampleLibraryTests/HelloDynamoZeroTouchTests.cs @@ -44,6 +44,7 @@ namespace SampleLibraryTests class HelloDynamoZeroTouchTests : GeometricTestBase { [Test] + [Category("NEEDS_GEOM_LIB")] public void PassingTest() { var myObject = Point.ByCoordinates(5, 5, 5); @@ -51,6 +52,7 @@ public void PassingTest() } [Test] + [Category("NEEDS_GEOM_LIB")] public void FailingTest() { var p1 = Point.ByCoordinates(0, 0, 0); diff --git a/src/SampleLibraryTests/Properties/AssemblyInfo.cs b/src/SampleLibraryTests/Properties/AssemblyInfo.cs index 4a4e84a..2ff505a 100644 --- a/src/SampleLibraryTests/Properties/AssemblyInfo.cs +++ b/src/SampleLibraryTests/Properties/AssemblyInfo.cs @@ -1,9 +1,14 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +using NUnit.Framework; +using System.Reflection; using System.Runtime.InteropServices; +using System.Threading; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SampleLibraryTests")] [assembly: Guid("c3d8c6fc-62ad-4272-91a9-492be76577e5")] + +// The RequiresThread(ApartmentState.STA) attribute is required by +// NUNit to run all tests, that use the UI, on the same thread. +[assembly: RequiresThread(ApartmentState.STA)] \ No newline at end of file diff --git a/src/SampleLibraryTests/RectangleUnitsExample.dyn b/src/SampleLibraryTests/RectangleUnitsExample.dyn new file mode 100644 index 0000000..3952197 --- /dev/null +++ b/src/SampleLibraryTests/RectangleUnitsExample.dyn @@ -0,0 +1,616 @@ +{ + "Uuid": "3ac347e0-9d70-4b12-b979-f0727b83d645", + "IsCustomNode": false, + "Description": "", + "Name": "RectangleUnitsExample", + "ElementResolver": { + "ResolutionMap": {} + }, + "Inputs": [], + "Outputs": [], + "Nodes": [ + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "Id": "1468a989f8d8470d8a1891ffe2a63c04", + "NodeType": "FunctionNode", + "Inputs": [ + { + "Id": "523c2c6971f34847968b5910114b17c5", + "Name": "width", + "Description": "double", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "342cfe4682354c68bbf2b6111463608c", + "Name": "length", + "Description": "double", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "c6fe1be34aa94c2c90c94a6eb687068f", + "Name": "RectangleExample", + "Description": "RectangleExample", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "FunctionSignature": "SampleZeroTouchUnits.RectangleExample.RectangleExample@double,double", + "Replication": "Auto", + "Description": "RectangleExample.RectangleExample (width: double, length: double): RectangleExample" + }, + { + "ConcreteType": "CoreNodeModels.Input.DoubleInput, CoreNodeModels", + "NumberType": "Double", + "Id": "ed3d204c241345fba0b32a7aa03ee3c9", + "NodeType": "NumberInputNode", + "Inputs": [], + "Outputs": [ + { + "Id": "d38f49da7d684924a77eeb9cc49833f9", + "Name": "", + "Description": "Double", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Creates a number", + "InputValue": 10.0 + }, + { + "ConcreteType": "CoreNodeModels.Input.DoubleInput, CoreNodeModels", + "NumberType": "Double", + "Id": "c9ac861739704856bbe0adaa53c14bbf", + "NodeType": "NumberInputNode", + "Inputs": [], + "Outputs": [ + { + "Id": "f374de24406041318a14a9a45588b464", + "Name": "", + "Description": "Double", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Creates a number", + "InputValue": 5.0 + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "Id": "c71a8875053e4e11b8caa8c89f7d2f5b", + "NodeType": "FunctionNode", + "Inputs": [ + { + "Id": "01e1ca45e9d949b39fb78704b084485c", + "Name": "rectangleExample", + "Description": "SampleZeroTouchUnits.RectangleExample", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "6f8baaafc728429f8816c0ca7f109688", + "Name": "targetUnit", + "Description": "Unit", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "660c8e52a9724e9eb3826e45b364304a", + "Name": "double", + "Description": "double", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "FunctionSignature": "SampleZeroTouchUnits.RectangleExample.GetLength@DynamoUnits.Unit", + "Replication": "Auto", + "Description": "RectangleExample.GetLength (targetUnit: Unit): double" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "Id": "225fd1f75d68410f8a3b41f589105447", + "NodeType": "FunctionNode", + "Inputs": [ + { + "Id": "a39eac5d78a045fdbbeb5ea85a7704ca", + "Name": "rectangleExample", + "Description": "SampleZeroTouchUnits.RectangleExample", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "0cb47f72df45457bad4583e55b88824b", + "Name": "targetUnit", + "Description": "Unit", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "7cae6a8028f24be48c1313ef8d3135b6", + "Name": "double", + "Description": "double", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "FunctionSignature": "SampleZeroTouchUnits.RectangleExample.GetWidth@DynamoUnits.Unit", + "Replication": "Auto", + "Description": "RectangleExample.GetWidth (targetUnit: Unit): double" + }, + { + "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", + "Id": "aa5a7e113ff94999922b1e4d14295c4d", + "NodeType": "FunctionNode", + "Inputs": [ + { + "Id": "d4d1e255723246a6b3d87c073d1c2f5e", + "Name": "rectangleExample", + "Description": "SampleZeroTouchUnits.RectangleExample", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + }, + { + "Id": "e9cdb2478e374180b9b721f30c1066ec", + "Name": "targetUnit", + "Description": "Unit", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "2bcd40f1919841f7b19d3279db495ec1", + "Name": "string", + "Description": "string", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "FunctionSignature": "SampleZeroTouchUnits.RectangleExample.GetArea@DynamoUnits.Unit", + "Replication": "Auto", + "Description": "RectangleExample.GetArea (targetUnit: Unit): string" + }, + { + "ConcreteType": "UnitsUI.Units, UnitsNodeModels", + "SelectedIndex": 25, + "SelectedString": "Centimeters", + "Id": "e4c3a5250ea4473d99bb4e046319a6bf", + "NodeType": "ExtensionNode", + "Inputs": [], + "Outputs": [ + { + "Id": "b247c85016d648ed96695930382df729", + "Name": "Unit", + "Description": "The selected Unit", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Select a Unit type" + }, + { + "ConcreteType": "UnitsUI.Units, UnitsNodeModels", + "SelectedIndex": 199, + "SelectedString": "Meters", + "Id": "f795ea681a5f496ba73ec083e8ddff00", + "NodeType": "ExtensionNode", + "Inputs": [], + "Outputs": [ + { + "Id": "a4bcecb84c4b4c42b58c8887e48441b8", + "Name": "Unit", + "Description": "The selected Unit", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Select a Unit type" + }, + { + "ConcreteType": "UnitsUI.Units, UnitsNodeModels", + "SelectedIndex": 295, + "SelectedString": "Square feet", + "Id": "69941e465d0a447482ff87f7d208fdc8", + "NodeType": "ExtensionNode", + "Inputs": [], + "Outputs": [ + { + "Id": "6fd7cb28a036466295fa375667bed5a4", + "Name": "Unit", + "Description": "The selected Unit", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Select a Unit type" + }, + { + "ConcreteType": "CoreNodeModels.Watch, CoreNodeModels", + "WatchWidth": 42.0, + "WatchHeight": 38.0, + "Id": "15b2e81d84df4a17ae348ee982ab87d9", + "NodeType": "ExtensionNode", + "Inputs": [ + { + "Id": "8958560939ac47f28472e3d20917fe1d", + "Name": "", + "Description": "Node to show output from", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "fd6fa7d1a0f84b53bc403b0bc71a0c47", + "Name": "", + "Description": "Node output", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Visualizes a node's output" + }, + { + "ConcreteType": "CoreNodeModels.Watch, CoreNodeModels", + "WatchWidth": 28.0, + "WatchHeight": 38.0, + "Id": "77e2a5bb3d464c5694f444ea1e064deb", + "NodeType": "ExtensionNode", + "Inputs": [ + { + "Id": "a4b19c323ae04f139046bf61232ffb65", + "Name": "", + "Description": "Node to show output from", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "1c4ff92ffdaa42d3b31484717ae29926", + "Name": "", + "Description": "Node output", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Visualizes a node's output" + }, + { + "ConcreteType": "CoreNodeModels.Watch, CoreNodeModels", + "WatchWidth": 170.0, + "WatchHeight": 38.0, + "Id": "bbb9d9f6be8e498e8b9cb8cae214c921", + "NodeType": "ExtensionNode", + "Inputs": [ + { + "Id": "69d539c959d04a4faaccd014bde7ca31", + "Name": "", + "Description": "Node to show output from", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Outputs": [ + { + "Id": "b6add764bf564344a4f3fa93f3108a8f", + "Name": "", + "Description": "Node output", + "UsingDefaultValue": false, + "Level": 2, + "UseLevels": false, + "KeepListStructure": false + } + ], + "Replication": "Disabled", + "Description": "Visualizes a node's output" + } + ], + "Connectors": [ + { + "Start": "c6fe1be34aa94c2c90c94a6eb687068f", + "End": "01e1ca45e9d949b39fb78704b084485c", + "Id": "40f11139baf94cc7b0a741c070987e25", + "IsHidden": "False" + }, + { + "Start": "c6fe1be34aa94c2c90c94a6eb687068f", + "End": "a39eac5d78a045fdbbeb5ea85a7704ca", + "Id": "0638b5e3dec84aef90079122f4dd20f1", + "IsHidden": "False" + }, + { + "Start": "c6fe1be34aa94c2c90c94a6eb687068f", + "End": "d4d1e255723246a6b3d87c073d1c2f5e", + "Id": "7cbc02d5c04140fd9fa2addf9a620e84", + "IsHidden": "False" + }, + { + "Start": "d38f49da7d684924a77eeb9cc49833f9", + "End": "523c2c6971f34847968b5910114b17c5", + "Id": "797a725db51c426782fd50dce6cfaada", + "IsHidden": "False" + }, + { + "Start": "f374de24406041318a14a9a45588b464", + "End": "342cfe4682354c68bbf2b6111463608c", + "Id": "6da49122485442aa8a9d605741434d4e", + "IsHidden": "False" + }, + { + "Start": "660c8e52a9724e9eb3826e45b364304a", + "End": "8958560939ac47f28472e3d20917fe1d", + "Id": "9bd621413636438dba36c0e7c2deeea2", + "IsHidden": "False" + }, + { + "Start": "7cae6a8028f24be48c1313ef8d3135b6", + "End": "a4b19c323ae04f139046bf61232ffb65", + "Id": "1d162031b0fe4401afcf5c3b69cdbf11", + "IsHidden": "False" + }, + { + "Start": "2bcd40f1919841f7b19d3279db495ec1", + "End": "69d539c959d04a4faaccd014bde7ca31", + "Id": "2a220a5a2a68450c894a8963931783a9", + "IsHidden": "False" + }, + { + "Start": "b247c85016d648ed96695930382df729", + "End": "6f8baaafc728429f8816c0ca7f109688", + "Id": "b94c50890dcb42b78188ace645d66178", + "IsHidden": "False" + }, + { + "Start": "a4bcecb84c4b4c42b58c8887e48441b8", + "End": "0cb47f72df45457bad4583e55b88824b", + "Id": "2bdf345697d6455da45a27029ed58d75", + "IsHidden": "False" + }, + { + "Start": "6fd7cb28a036466295fa375667bed5a4", + "End": "e9cdb2478e374180b9b721f30c1066ec", + "Id": "de3724ee2ce04af0b9b9e512327fe096", + "IsHidden": "False" + } + ], + "Dependencies": [], + "NodeLibraryDependencies": [ + { + "Name": "SampleZeroTouchUnits.dll", + "ReferenceType": "ZeroTouch", + "Nodes": [ + "1468a989f8d8470d8a1891ffe2a63c04", + "c71a8875053e4e11b8caa8c89f7d2f5b", + "225fd1f75d68410f8a3b41f589105447", + "aa5a7e113ff94999922b1e4d14295c4d" + ] + } + ], + "EnableLegacyPolyCurveBehavior": null, + "Thumbnail": "", + "GraphDocumentationURL": null, + "ExtensionWorkspaceData": [ + { + "ExtensionGuid": "28992e1d-abb9-417f-8b1b-05e053bee670", + "Name": "Properties", + "Version": "3.1", + "Data": {} + } + ], + "Author": "", + "Linting": { + "activeLinter": "None", + "activeLinterId": "7b75fb44-43fd-4631-a878-29f4d5d8399a", + "warningCount": 0, + "errorCount": 0 + }, + "Bindings": [], + "View": { + "Dynamo": { + "ScaleFactor": 1.0, + "HasRunWithoutCrash": true, + "IsVisibleInDynamoLibrary": true, + "Version": "3.1.0.3411", + "RunType": "Automatic", + "RunPeriod": "1000" + }, + "Camera": { + "Name": "_Background Preview", + "EyeX": -17.0, + "EyeY": 24.0, + "EyeZ": 50.0, + "LookX": 12.0, + "LookY": -13.0, + "LookZ": -58.0, + "UpX": 0.0, + "UpY": 1.0, + "UpZ": 0.0 + }, + "ConnectorPins": [], + "NodeViews": [ + { + "Id": "1468a989f8d8470d8a1891ffe2a63c04", + "Name": "RectangleExample.RectangleExample", + "IsSetAsInput": false, + "IsSetAsOutput": true, + "Excluded": false, + "ShowGeometry": true, + "X": 561.5, + "Y": 33.5 + }, + { + "Id": "ed3d204c241345fba0b32a7aa03ee3c9", + "Name": "Number", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 339.11603418889285, + "Y": 35.62147890968433 + }, + { + "Id": "c9ac861739704856bbe0adaa53c14bbf", + "Name": "Number", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 350.15809208781684, + "Y": 163.6425078591463 + }, + { + "Id": "c71a8875053e4e11b8caa8c89f7d2f5b", + "Name": "RectangleExample.GetLength", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 1053.5, + "Y": 33.5 + }, + { + "Id": "225fd1f75d68410f8a3b41f589105447", + "Name": "RectangleExample.GetWidth", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 1052.5, + "Y": 192.5 + }, + { + "Id": "aa5a7e113ff94999922b1e4d14295c4d", + "Name": "RectangleExample.GetArea", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 1063.5, + "Y": 377.5 + }, + { + "Id": "e4c3a5250ea4473d99bb4e046319a6bf", + "Name": "Units", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 626.0, + "Y": 250.0 + }, + { + "Id": "f795ea681a5f496ba73ec083e8ddff00", + "Name": "Units", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 625.0, + "Y": 383.0 + }, + { + "Id": "69941e465d0a447482ff87f7d208fdc8", + "Name": "Units", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 623.0, + "Y": 519.0 + }, + { + "Id": "15b2e81d84df4a17ae348ee982ab87d9", + "Name": "Watch", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 1431.4173995248607, + "Y": 8.41299750528276 + }, + { + "Id": "77e2a5bb3d464c5694f444ea1e064deb", + "Name": "Watch", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 1429.1072443762355, + "Y": 189.94506627386255 + }, + { + "Id": "bbb9d9f6be8e498e8b9cb8cae214c921", + "Name": "Watch", + "IsSetAsInput": false, + "IsSetAsOutput": false, + "Excluded": false, + "ShowGeometry": true, + "X": 1421.8472359898235, + "Y": 374.27115097662556 + } + ], + "Annotations": [], + "X": -42.2040696713932, + "Y": 53.81309391588489, + "Zoom": 0.5974870948157864 + } +} \ No newline at end of file diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index b4c12e0..f4928c8 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -12,10 +12,17 @@ - PreserveNewest + PreserveNewest + + + PreserveNewest + + + Always - + + \ No newline at end of file diff --git a/src/SampleLibraryTests/TestServices.dll.config b/src/SampleLibraryTests/TestServices.dll.config new file mode 100644 index 0000000..fb4d682 --- /dev/null +++ b/src/SampleLibraryTests/TestServices.dll.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/SampleLibraryTests/ZeroTouchUnitsSystemTests.cs b/src/SampleLibraryTests/ZeroTouchUnitsSystemTests.cs new file mode 100644 index 0000000..1e56dd7 --- /dev/null +++ b/src/SampleLibraryTests/ZeroTouchUnitsSystemTests.cs @@ -0,0 +1,80 @@ +using System.Collections.Generic; +using SystemTestServices; + +using Autodesk.DesignScript.Runtime; +using Dynamo.Graph.Nodes.ZeroTouch; +using Dynamo.Tests; + +using NUnit.Framework; + +namespace SampleLibraryTests +{ + /// + /// ZeroTouchUnitsSystemTests is a test fixture that contains + /// system tests for Dynamo using Units APIs. System tests test the entire + /// Dynamo system including the UI. They do this by starting + /// a session of Dynamo, then opening .dyn files, executing them + /// and comparing the values returned from Dynamo with those + /// stored on our test class. + /// + /// IMPORTANT! + /// System tests have dependencies on Dynamo core dlls. In + /// order for these tests to work, your test dll needs to be + /// located in the Dynamo core directory. The project currently assumes + /// that Dynamo is built in a directory adjacent to the DynamoSamples + /// repository, so a relative path is set to the debug build folder for Dynamo. + /// If your setup is different, then you will need to explicitly set the output path + /// to your Dynamo installation directory. + /// + [TestFixture] + + public class ZeroTouchUnitsSystemTests : SystemTestBase + { + protected override void GetLibrariesToPreload(List libraries) + { + libraries.Add("FunctionObject.ds"); + libraries.Add("BuiltIn.ds"); + libraries.Add("DSCoreNodes.dll"); + libraries.Add("VMDataBridge.dll"); + libraries.Add("DynamoConversions.dll"); + libraries.Add("DynamoUnits.dll"); + libraries.Add("DesignScriptBuiltin.dll"); + libraries.Add("..\\..\\..\\..\\dynamo_package\\Dynamo Samples\\bin\\SampleZeroTouchUnits.dll"); + base.GetLibrariesToPreload(libraries); + } + + // The RequiresSTA attribute is required by + // NUNit to run tests that use the UI. + [Test, Apartment(System.Threading.ApartmentState.STA)] + public void HelloRectangleUnitsTest() + { + // RectangleUnitsExample.dyn is a test .dyn file which + // should be copied to the output directory, so it's available + // for testing. You can also change this path to anywhere you + // would like to get your test file from, but it has to be + // a relative path from the dynamo core directory (the working directory). + + OpenAndRunDynamoDefinition(@".\RectangleUnitsExample.dyn"); + + // Ensure that the graph opened without any "dummy nodes". + // Dummy nodes would appear if your graph had a node that + // could not be found in the library. + + AssertNoDummyNodes(); + + // Get the nodes from the workspace. + var out1 = Model.CurrentWorkspace.NodeFromWorkspace("{15b2e81d-84df-4a17-ae34-8ee982ab87d9}") as CoreNodeModels.Watch; + var out2 = Model.CurrentWorkspace.NodeFromWorkspace("{77e2a5bb-3d46-4c56-94f4-44ea1e064deb}") as CoreNodeModels.Watch; + var out3 = Model.CurrentWorkspace.NodeFromWorkspace("{bbb9d9f6-be8e-498e-8b9c-b8cae214c921}") as CoreNodeModels.Watch; + Assert.NotNull(out1); + Assert.NotNull(out2); + Assert.NotNull(out3); + + // Ensure that the value of that node after evaluation is + // the value that we are looking for. + Assert.AreEqual(out1.CachedValue, 500); + Assert.AreEqual(out2.CachedValue, 5); + Assert.AreEqual(out3.CachedValue, "538.195520835486ft^2"); + } + } +} diff --git a/src/SampleLibraryUI/SampleLibraryUI.csproj b/src/SampleLibraryUI/SampleLibraryUI.csproj index 229eba6..348d7cb 100644 --- a/src/SampleLibraryUI/SampleLibraryUI.csproj +++ b/src/SampleLibraryUI/SampleLibraryUI.csproj @@ -24,9 +24,9 @@ - - - + + + diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index f18e7c4..5053700 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -6,15 +6,16 @@ Properties SampleLibraryZeroTouch SampleLibraryZeroTouch + net8.0 true bin\$(Configuration)\SampleLibraryZeroTouch.XML - - - + + + diff --git a/src/SampleLinter/SampleLinter.csproj b/src/SampleLinter/SampleLinter.csproj index bb592fc..3f14971 100644 --- a/src/SampleLinter/SampleLinter.csproj +++ b/src/SampleLinter/SampleLinter.csproj @@ -8,15 +8,16 @@ Copyright © 2023 2.0.1.0 2.0.1.0 + net8.0 true bin\$(Configuration)\ - - - + + + diff --git a/src/SampleViewExtension/SampleViewExtension.csproj b/src/SampleViewExtension/SampleViewExtension.csproj index a2b6881..ab6982a 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -10,9 +10,9 @@ true - - - + + + diff --git a/src/SampleZeroTouchUnits/RectangleExample.cs b/src/SampleZeroTouchUnits/RectangleExample.cs index a7be5fb..288ae02 100644 --- a/src/SampleZeroTouchUnits/RectangleExample.cs +++ b/src/SampleZeroTouchUnits/RectangleExample.cs @@ -13,7 +13,7 @@ namespace SampleZeroTouchUnits /// public class RectangleExample { - const string meters = "autodesk.unit.unit:meters"; + const string meters = "autodesk.unit.unit:meters"; const string meters2 = "autodesk.unit.unit:squareMeters"; /// @@ -31,10 +31,10 @@ public class RectangleExample private Unit AreaUnit; /// - /// + /// Creates an instance of RectangleExample with all units defaulted to metric /// - /// - /// + /// The width of RectangleExample, defaulted to meters + /// The length of RectangleExample, defaulted to meters public RectangleExample(double width, double length) { Length = length; @@ -45,12 +45,12 @@ public RectangleExample(double width, double length) } /// - /// + /// Creates an instance of RectangleExample with customizable untis /// - /// - /// - /// - /// + /// The width of RectangleExample + /// The length of RectangleExample + /// The unit for width + /// The unit for length public RectangleExample(double width, double length, Unit widthUnit, Unit lengthUnit) { Width = width; @@ -63,9 +63,9 @@ public RectangleExample(double width, double length, Unit widthUnit, Unit length } /// - /// + /// Get the length converted to a target unit. /// - /// + /// The target unit. Defaults to null /// /// public double GetLength(Unit targetUnit = null) @@ -83,9 +83,9 @@ public double GetLength(Unit targetUnit = null) } /// - /// + /// Get the width converted to a target unit. /// - /// + /// The target unit. Defaults to null /// /// public double GetWidth(Unit targetUnit) @@ -112,10 +112,10 @@ string GetFirstSymbolText(Unit unit) } /// - /// + /// Get the area of the rectangle. Computed as width * length /// - /// - /// + /// The target unit for the area value, defaults to null + /// A string containing the area value and unit symbol. Ex. "100ft^2" /// public string GetArea(Unit targetUnit = null) { diff --git a/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj b/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj index b739b86..b318676 100644 --- a/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj +++ b/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj @@ -6,15 +6,16 @@ Properties SampleZeroTouchUnits SampleZeroTouchUnits + net8.0 true bin\$(Configuration)\SampleZeroTouchUnits.XML - - - + + + From 63b81b4179f7335b655a85d97603961bb020f613 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 11:30:54 +0800 Subject: [PATCH 16/27] Bump actions/upload-artifact from 3.1.3 to 4.3.1 in /.github/workflows (#54) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.3 to 4.3.1. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3.1.3...v4.3.1) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1e6f1f..f6b2290 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,13 +72,13 @@ jobs: run: | dotnet test ${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests -p:Configuration=Release --filter "TestCategory!=Failure&TestCategory!=NEEDS_GEOM_LIB" --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DynamoSamples\TestResults - name: Upload build artifact - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@v4.3.1 with: name: DynamoSamples path: ${{ github.workspace }}\DynamoSamples\dynamo_package retention-days: 7 - name: Upload test artifact - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@v4.3.1 with: name: TestResults path: ${{ github.workspace }}\DynamoSamples\TestResults From a8aedd153d69e82db1d87a74631e43e13bdf5431 Mon Sep 17 00:00:00 2001 From: pinzart90 <46732933+pinzart90@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:09:36 -0500 Subject: [PATCH 17/27] Update CS.props (#55) --- src/Config/CS.props | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Config/CS.props b/src/Config/CS.props index cc62aa7..4cd077b 100644 --- a/src/Config/CS.props +++ b/src/Config/CS.props @@ -9,7 +9,6 @@ prompt 4 false - en-US Library false None @@ -38,4 +37,4 @@ 4 false - \ No newline at end of file + From 9610d17927a01cc4da6c498d710e0af681474904 Mon Sep 17 00:00:00 2001 From: Michael Kirschner Date: Wed, 27 Mar 2024 13:18:19 -0400 Subject: [PATCH 18/27] Update DropDown.cs (#57) --- src/SampleLibraryUI/Examples/DropDown.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SampleLibraryUI/Examples/DropDown.cs b/src/SampleLibraryUI/Examples/DropDown.cs index 2ded7cf..71f8f64 100644 --- a/src/SampleLibraryUI/Examples/DropDown.cs +++ b/src/SampleLibraryUI/Examples/DropDown.cs @@ -15,7 +15,7 @@ public class DropDownExample : DSDropDownBase public DropDownExample() : base("item"){} // Starting with Dynamo v2.0 you must add Json constructors for all nodeModel - // dervived nodes to support the move from an Xml to Json file format. Failing to + // derived nodes to support the move from an Xml to Json file format. Failing to // do so will result in incorrect ports being generated upon serialization/deserialization. // This constructor is called when opening a Json graph. We must also pass the deserialized // ports with the json constructor and then call the base class passing the ports as parameters. From 9b38f43b1642576b810255da8aa341f0acd4d858 Mon Sep 17 00:00:00 2001 From: Michael Kirschner Date: Tue, 9 Apr 2024 17:32:49 -0400 Subject: [PATCH 19/27] Update README.md (#58) * Update README.md * Delete src/Config/user_local.props --- README.md | 11 +++-------- src/Config/user_local.props | 12 ------------ 2 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 src/Config/user_local.props diff --git a/README.md b/README.md index 53050cc..c7377a3 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ These samples make use of the [Dynamo NuGet packages](https://www.nuget.org/pack ## Requirements -- Visual Studio 2019 -- .NET Framework 4.8 +- Visual Studio 2022 +- .NET8 ## Instructions - Clone the repository. - Choose a branch: - - The master branch of Dynamo Samples corresponds to the master branch of Dynamo. To build against a specific version, choose that version's branch. i.e. 0.8.0, 0.9.0, etc. + - The master branch of Dynamo Samples corresponds to the master branch of Dynamo. To build against a specific version, choose that version's branch or tag. i.e. 0.8.0, 0.9.0, etc. - Open `DynamoSamples.sln` with Visual Studio. - Build using the `Debug/Any CPU` configuration. - The `dynamo_package` folder at the root of the repository will now have the built libraries. The `Dynamo Samples` folder in that directory can be copied directly to your Dynamo packages directory:`C:\Users\\AppData\Roaming\Dynamo Core\\packages`. @@ -27,8 +27,3 @@ These samples make use of the [Dynamo NuGet packages](https://www.nuget.org/pack - `SampleViewExtension.dll` which should be copied to your root Dynamo build location - `SampleViewExtension_ViewExtensionDefinition` which should be copied to the `viewExtensions` folder inside your root Dynamo build location - Run Dynamo. You should find `SampleLibraryUI` and `SampleLibraryZeroTouch` categories in your library and the `View` tab inside of Dynamo should now contain `Show View Extension Sample Window`. - -Assembly Reference -Path to assembly for binaries are defined in CS.props and user_local.props which can be found at $(SolutionDirectory)\Config -user_local.props defines path to binaries found in the bin folder of the local Dynamo repository -If the specified binary is not found, the path to the nuget packages binaries will be used instead which is defined in the CS.props file diff --git a/src/Config/user_local.props b/src/Config/user_local.props deleted file mode 100644 index a5848fb..0000000 --- a/src/Config/user_local.props +++ /dev/null @@ -1,12 +0,0 @@ - - - - $(SolutionDir)..\..\Dynamo\bin\$(Platform)\$(Configuration) - $(DYNAMOAPI) - $(DYNAMOAPI) - $(DYNAMOAPI) - $(DYNAMOAPI)\nodes - $(DYNAMOAPI) - $(DYNAMOAPI) - - \ No newline at end of file From 1d97b5b9b987be4ecb855617af0ef3c9eaed7242 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:02:57 -0400 Subject: [PATCH 20/27] Bump microsoft/setup-msbuild from 1.3 to 2 in /.github/workflows (#59) Bumps [microsoft/setup-msbuild](https://github.com/microsoft/setup-msbuild) from 1.3 to 2. - [Release notes](https://github.com/microsoft/setup-msbuild/releases) - [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md) - [Commits](https://github.com/microsoft/setup-msbuild/compare/v1.3...v2) --- updated-dependencies: - dependency-name: microsoft/setup-msbuild dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f6b2290..4dfdedb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: - name: Disable problem matcher run: echo "::remove-matcher owner=csc::" - name: Setup msbuild - uses: microsoft/setup-msbuild@v1.3 + uses: microsoft/setup-msbuild@v2 - name: Install dependencies for SampleIntegration run: | dotnet restore ${{ github.workspace }}\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release --runtime=win-x64 From d339b6db0e326f5d760bc4072bc66cf024da72a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:20:55 -0400 Subject: [PATCH 21/27] Bump actions/upload-artifact from 4.3.1 to 4.3.3 in /.github/workflows (#61) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.1 to 4.3.3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4.3.1...v4.3.3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4dfdedb..30afc18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,13 +72,13 @@ jobs: run: | dotnet test ${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests -p:Configuration=Release --filter "TestCategory!=Failure&TestCategory!=NEEDS_GEOM_LIB" --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DynamoSamples\TestResults - name: Upload build artifact - uses: actions/upload-artifact@v4.3.1 + uses: actions/upload-artifact@v4.3.3 with: name: DynamoSamples path: ${{ github.workspace }}\DynamoSamples\dynamo_package retention-days: 7 - name: Upload test artifact - uses: actions/upload-artifact@v4.3.1 + uses: actions/upload-artifact@v4.3.3 with: name: TestResults path: ${{ github.workspace }}\DynamoSamples\TestResults From bc05df04c9ae2382ce14246a6dad1e7bafb8da16 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" Date: Mon, 10 Jun 2024 11:31:35 -0400 Subject: [PATCH 22/27] Update build.yml (#62) --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30afc18..b20c1df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: } - name: Get DynamoRuntime from s3 run: | - curl -o DynamoRuntime.zip https://dyn-builds-data.s3-us-west-2.amazonaws.com/DynamoCoreRuntime_3.1.0.4081_20240212T2057.zip + curl -o DynamoRuntime.zip https://downloads.dynamobuilds.com/DynamoCoreRuntime3.1.0.zip ls - name: Extract DynamoRuntime run: | @@ -82,4 +82,4 @@ jobs: with: name: TestResults path: ${{ github.workspace }}\DynamoSamples\TestResults - retention-days: 1 \ No newline at end of file + retention-days: 1 From f3ca98b9cb9c62548f23ec63f9d333ea92bac7f2 Mon Sep 17 00:00:00 2001 From: Deyan Nenov Date: Tue, 21 Oct 2025 15:51:56 +0100 Subject: [PATCH 23/27] DYN-9195: Net 10.0 update (#67) * add node icon example - adding a simple icon to a node to demonstrate the 8.0 workflow to contrast and show a fix when introducing 10.0 * image to png update - now the image is added as a File and in .png format - this alone works in order to correctly provide the icon to Dynamo * .net 10.0 upgrade - updated all projects to target .net 10.0 - updated workflow yaml - updated readme reference to dotnet * add icon resources to build directory - add customisation.dll file to the build output directory * revert formatting changes * nuget update - updated nuget package references * nugets bump to 2685 * remove redundant file * removed resource custom tool * Update build.yml * update to nugs, yml - update the dotnet-version: "10.0.100-preview.5.25277.114" - update to latest nugets --------- Co-authored-by: Ashish Aggarwal --- .github/workflows/build.yml | 10 +- README.md | 2 +- src/SampleExtension/SampleExtension.csproj | 42 +++--- .../SampleIntegration.csproj | 4 +- .../SampleLibraryTests.csproj | 54 ++++---- ...braryUI.Examples.DropDownExample.Large.png | Bin 0 -> 950 bytes .../Resources/SampleLibraryUI.Designer.cs | 83 ++++++++++++ .../Resources/SampleLibraryUI.resx | 127 ++++++++++++++++++ .../Resources/SampleLibraryUIImages.resources | Bin 0 -> 1781 bytes ...braryUI.Examples.DropDownExample.Small.png | Bin 0 -> 431 bytes src/SampleLibraryUI/SampleLibraryUI.csproj | 93 +++++++------ .../SampleLibraryZeroTouch.csproj | 8 +- src/SampleLinter/SampleLinter.csproj | 8 +- .../SampleViewExtension.csproj | 58 ++++---- .../SampleZeroTouchUnits.csproj | 8 +- 15 files changed, 360 insertions(+), 137 deletions(-) create mode 100644 src/SampleLibraryUI/Resources/LargeIcons/SampleLibraryUI.Examples.DropDownExample.Large.png create mode 100644 src/SampleLibraryUI/Resources/SampleLibraryUI.Designer.cs create mode 100644 src/SampleLibraryUI/Resources/SampleLibraryUI.resx create mode 100644 src/SampleLibraryUI/Resources/SampleLibraryUIImages.resources create mode 100644 src/SampleLibraryUI/Resources/SmallIcons/SampleLibraryUI.Examples.DropDownExample.Small.png diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b20c1df..b08790a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -# Build SampleIntegration.sln and DynamoSamples.sln with .NET 8.0 +# Build SampleIntegration.sln and DynamoSamples.sln with .NET 10.0 name: Build on: @@ -12,14 +12,14 @@ jobs: runs-on: windows-latest steps: - name: Checkout DynamoSamples Repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: path: DynamoSamples repository: DynamoDS/DynamoSamples - name: Setup dotnet - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '8.0.x' + dotnet-version: "10.0.100-preview.5.25277.114" - name: Disable problem matcher run: echo "::remove-matcher owner=csc::" - name: Setup msbuild @@ -66,7 +66,7 @@ jobs: ls - name: Extract DynamoRuntime run: | - 7z x DynamoRuntime.zip -o${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests\bin\Release\DynamoRuntime + 7z x DynamoRuntime.zip -o${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests\bin\Release\DynamoRuntime - name: Run test with the dotnet CLI run: | diff --git a/README.md b/README.md index c7377a3..3f42c43 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ These samples make use of the [Dynamo NuGet packages](https://www.nuget.org/pack ## Requirements - Visual Studio 2022 -- .NET8 +- .NET 10.0 ## Instructions diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index 249af7b..50fab8f 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -1,22 +1,22 @@ - - - - - - Debug - SampleExtension - SampleExtension - net8.0 - - - true - - - - Always - - - - - + + + + + + Debug + SampleExtension + SampleExtension + net10.0 + + + true + + + + Always + + + + + \ No newline at end of file diff --git a/src/SampleIntegration/SampleIntegration.csproj b/src/SampleIntegration/SampleIntegration.csproj index 9c549c7..50d846e 100644 --- a/src/SampleIntegration/SampleIntegration.csproj +++ b/src/SampleIntegration/SampleIntegration.csproj @@ -5,9 +5,9 @@ SampleIntegration SampleIntegration - net8.0 + net10.0 - + \ No newline at end of file diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index f4928c8..9f52e83 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -1,28 +1,28 @@ - - - - - - Debug - SampleLibraryTests - SampleLibraryTests - - net8.0-windows - true - - - - PreserveNewest - - - PreserveNewest - - - Always - - - - - - + + + + + + Debug + SampleLibraryTests + SampleLibraryTests + + net10.0-windows + true + + + + PreserveNewest + + + PreserveNewest + + + Always + + + + + + \ No newline at end of file diff --git a/src/SampleLibraryUI/Resources/LargeIcons/SampleLibraryUI.Examples.DropDownExample.Large.png b/src/SampleLibraryUI/Resources/LargeIcons/SampleLibraryUI.Examples.DropDownExample.Large.png new file mode 100644 index 0000000000000000000000000000000000000000..778a21e9df9a9896c8cdf59b1f53568df196ee5d GIT binary patch literal 950 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoEa{HEjtmSN`?>!lvI6;%C9V-A z!TD(=<%vb942~)JNvR5+xryniL8*x;m4zo$Z5SAsJv?0;Ln`9l-ny83+dzQrLC*w1 z8z;98IqoNl$|)@U4|usU8i8Uxeh<=ZD_Qyrjxv_N``Mqd(M?0P@jo-imZaED_b#iT zswySy;ML@gnvN5J|90NEZ~x)`C4Qla>4KK62NvJ|A#K`oIZtAFxc2#o`?Ka6<6Mx6R*B z=X>j?-)ZY>>(8>a z#Gik};HA#;zp2!NdEUm2hb`vrp3~;?#I)pq_%-(r2X5EA>TD~tYHOVMY*$yws*O6& zWvm?juem&Ny7M1iAKR5ieTj4U9^NWizC_?l^*Y&v$bRz=HNWli_^lMKKG>nCWG($O zu4HL7uf>$P|Mfn<2tRD`_VCxccXnnv{)?Bn>b>~?`P=%Ds~_x~yS8oj>xNbA8`7-5 zOSL;@MSi%m?mFLv%wwYZR!b_P)?J=-SYfM9MIQUh!i~BsU##GlHJELAqpsgP$LzQs z>x!=*IphxAEpa&0mR9_HR(rIj!`goL3yjrk{Eu%^G`HS#)xa-)VdCa;Pq2jP^_g8A zd)oOl@>CE1v9F#!h3U$#3K28*tu@ttOPTo}Jkphx3caJQ1u}QVGppc6*$X$L#pDjS zuPI;3u+{FJ0<+e#%PWtF8eFqHvDUcUA!fPA`)4LO%I8Fxqj&Gn1ZpeXzQxb;_`aHg zqqcwLtQLIJ^JR@YAZ~t5?q$O@*7I{~Cl`dh)%JMNkhH1`=+{S;)6F<9a~<42dz0-X z)~$LU_w4Qa2MmkVFB^2f*!+5|u5q;T?om;-Yq^~F7|*Xu4%(!D@6IE2)q>f}Jw7Hh zZ#)QfahOS&b{lJ9;elU*#)tHK(>0u2JXv`HrlW|0W%(hr>mdK II;Vst0HAZK)c^nh literal 0 HcmV?d00001 diff --git a/src/SampleLibraryUI/Resources/SampleLibraryUI.Designer.cs b/src/SampleLibraryUI/Resources/SampleLibraryUI.Designer.cs new file mode 100644 index 0000000..372832f --- /dev/null +++ b/src/SampleLibraryUI/Resources/SampleLibraryUI.Designer.cs @@ -0,0 +1,83 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SampleLibraryUI.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class SampleLibraryUI { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SampleLibraryUI() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleLibraryUI.Resources.SampleLibraryUI", typeof(SampleLibraryUI).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + public static byte[] SampleLibraryUI_Examples_DropDownExample_Large { + get { + object obj = ResourceManager.GetObject("SampleLibraryUI.Examples.DropDownExample.Large", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + public static byte[] SampleLibraryUI_Examples_DropDownExample_Small { + get { + object obj = ResourceManager.GetObject("SampleLibraryUI.Examples.DropDownExample.Small", resourceCulture); + return ((byte[])(obj)); + } + } + } +} diff --git a/src/SampleLibraryUI/Resources/SampleLibraryUI.resx b/src/SampleLibraryUI/Resources/SampleLibraryUI.resx new file mode 100644 index 0000000..fe16409 --- /dev/null +++ b/src/SampleLibraryUI/Resources/SampleLibraryUI.resx @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + .\LargeIcons\SampleLibraryUI.Examples.DropDownExample.Large.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + .\SmallIcons\SampleLibraryUI.Examples.DropDownExample.Small.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/SampleLibraryUI/Resources/SampleLibraryUIImages.resources b/src/SampleLibraryUI/Resources/SampleLibraryUIImages.resources new file mode 100644 index 0000000000000000000000000000000000000000..7fb109a7f8468639b9aa7c81eda07465519c6013 GIT binary patch literal 1781 zcmX?i>is@O1_p+SK%5g?SzMBus~417oL^d$oLUTL1*ImYq!#HYR*8GxXUf^%t3Noi54ZC+|=Nl{{sjzU0bQch;FcWPxwes*e}ZIZcpqG__J znW3ezNveT`r81^vrFkWpxv4PQgHubGfQ|xT5D0K|0io*IF_R)UdQJujB?569(D50G_W8T=-@=4gL4>mGczzKYy%RV0e3wb>~T!Mgf0tj=k0m(-* z$}NBtOS+@4BLl<6e(pbstU$hGiEBhjaDG}zd16s2gJVj5QmTSyZeltx6cbY_3s0un zFfcHCc)B=-RK&f#bust0fdJcso(Y0BPHr7?+)oshQ&{>R@N#7|0>yg#9;Dk=vh)`m zWh{U9vp-{_n}%%Te`by?NwJ;oT~{H&1+To4=vX_tsCzb&nI3Ht`>vKQ~KBx>P-TOWC1U!Tw8> z@2_(`{pf)wyWFmBUJhly)7ID4pJi)_KmUlqOP%F^Q>h2@yp0P$wSI^e%Rve;jee^?96oh7cXOGA6<CZoTQMfnWT>#LeZNU6(37j8z2$sKTCQ@)g8tKB;VX02tHR~`{HxMq1`t#P?S%yNJA%Nln;-29r{%Z6*L=jYZ=E(m+8 z?eU@^X;l}{ua7FHn{i&|I=FxKCfiA@TlGHf+1vLI7#6EvHt2q_`Sn;`<7nmGqoQip zayjoYo?n+7v`PQook!}b1+$lXd`xKGFyrV_mizU3Y$9PZyJfFQ)lCe)HQ#IHH&K;a zzkZ+R*mpuZtw8f2(;BN8iBhZHZ4pbbdXs)H-0at5?isJx9F7J4-8~wzT@maMA)RHFdSy2VvhUw|BPvM!?| zDCtzw+5eA&o@u1y>N-tJh8+&FQ&Ulr^V&pWdm(bH-)Sxoyj1&Yj-A zGROC6hSuVhH7%Qc5-P6D`uJ*ptjCS2zJ_czlc_gD&Mhl4oSJP>UAvl@=M2jtKa1;A zPU{*5TN-@Wl&)nkb$4R0Uc|Nihj@3)vaQ^6C4?<_W(|+E|AT2Us{>d6xNYw?_sA-r zr%xI!yMAw8;y=&!^70*wtDimO?ucqR_V~|Yplf%gIXs#gI$8Nk`|kR$pQ}3mR~?`K q%>TtJan3jQxcu(a_$-L3U4HrHAMJe%_fLNiFpq0{2#f)EoB;sn6v-t3 literal 0 HcmV?d00001 diff --git a/src/SampleLibraryUI/Resources/SmallIcons/SampleLibraryUI.Examples.DropDownExample.Small.png b/src/SampleLibraryUI/Resources/SmallIcons/SampleLibraryUI.Examples.DropDownExample.Small.png new file mode 100644 index 0000000000000000000000000000000000000000..10dea6c27ac4c223472923dc6986aada85e338a1 GIT binary patch literal 431 zcmV;g0Z{&lP)gcr0}h8AB7Z0E zv*r1F-p!`d>2x{`0N4UJ0vO}op8#M2um`YclVq zjCv&HGDocmulnj8SOrSCOevRb)FUaEOUt<`49rBL&bFsq&dax{Y)$28Dx;}c3q`*m{nDYX&rx*;LM^axs-_ID37o0}RXrqE0y1l*=tKQ#mm3vS%tVmAhe6 zE?CyT!VS2ZJ$by;R0dO-d<;8J;FesgQLFgdKSrIzs!ZkNfjNr%v!qX+J=3SS0juWW z3y4~T#^d~>-VA`bW - - - - - SampleLibraryUI - SampleLibraryUI - - net8.0-windows - true - - - true - bin\$(Configuration)\$(UICulture)\SampleLibraryUI.XML - - - - {bd13c4dc-9045-4e49-b637-b6182b0e3a7f} - SampleLibraryZeroTouch - False - - - - - - - - - - - - - - - - - - - - + + + + + + SampleLibraryUI + SampleLibraryUI + + net10.0-windows + true + + + true + bin\$(Configuration)\$(UICulture)\SampleLibraryUI.XML + + + + {bd13c4dc-9045-4e49-b637-b6182b0e3a7f} + SampleLibraryZeroTouch + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index 5053700..0a86ce9 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -6,16 +6,16 @@ Properties SampleLibraryZeroTouch SampleLibraryZeroTouch - net8.0 + net10.0 true bin\$(Configuration)\SampleLibraryZeroTouch.XML - - - + + + diff --git a/src/SampleLinter/SampleLinter.csproj b/src/SampleLinter/SampleLinter.csproj index 3f14971..9879523 100644 --- a/src/SampleLinter/SampleLinter.csproj +++ b/src/SampleLinter/SampleLinter.csproj @@ -8,16 +8,16 @@ Copyright © 2023 2.0.1.0 2.0.1.0 - net8.0 + net10.0 true bin\$(Configuration)\ - - - + + + diff --git a/src/SampleViewExtension/SampleViewExtension.csproj b/src/SampleViewExtension/SampleViewExtension.csproj index ab6982a..dfa8ff4 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -1,30 +1,30 @@ - - - - - - SampleViewExtension - SampleViewExtension - - net8.0-windows - true - - - - - - - - - Always - - - - - - - - - - + + + + + + SampleViewExtension + SampleViewExtension + + net10.0-windows + true + + + + + + + + + Always + + + + + + + + + + \ No newline at end of file diff --git a/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj b/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj index b318676..f21e4b2 100644 --- a/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj +++ b/src/SampleZeroTouchUnits/SampleZeroTouchUnits.csproj @@ -6,16 +6,16 @@ Properties SampleZeroTouchUnits SampleZeroTouchUnits - net8.0 + net10.0 true bin\$(Configuration)\SampleZeroTouchUnits.XML - - - + + + From 79c559486ac0454f38099413794c556944ed2c8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 10:52:33 -0400 Subject: [PATCH 24/27] Bump actions/setup-dotnet from 4 to 5 in /.github/workflows (#70) Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4 to 5. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From d85ba19531c83e399eac50ec69300d7391b03bdc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 10:52:58 -0400 Subject: [PATCH 25/27] Bump actions/upload-artifact from 4.3.3 to 4.6.2 in /.github/workflows (#69) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.6.2. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4.3.3...v4.6.2) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 4.6.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b08790a..52403be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,13 +72,13 @@ jobs: run: | dotnet test ${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests -p:Configuration=Release --filter "TestCategory!=Failure&TestCategory!=NEEDS_GEOM_LIB" --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DynamoSamples\TestResults - name: Upload build artifact - uses: actions/upload-artifact@v4.3.3 + uses: actions/upload-artifact@v4.6.2 with: name: DynamoSamples path: ${{ github.workspace }}\DynamoSamples\dynamo_package retention-days: 7 - name: Upload test artifact - uses: actions/upload-artifact@v4.3.3 + uses: actions/upload-artifact@v4.6.2 with: name: TestResults path: ${{ github.workspace }}\DynamoSamples\TestResults From 93d24d32ff7fe44a70b220f5402b0941d7a989b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 10:53:20 -0400 Subject: [PATCH 26/27] Bump actions/checkout from 4 to 5 in /.github/workflows (#68) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From 5af34f9e89659d49bea91ea717206a102601d01a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 06:39:52 -0700 Subject: [PATCH 27/27] Bump actions/upload-artifact from 4.6.2 to 5.0.0 in /.github/workflows (#71) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.2 to 5.0.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4.6.2...v5.0.0) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52403be..129e8b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,13 +72,13 @@ jobs: run: | dotnet test ${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests -p:Configuration=Release --filter "TestCategory!=Failure&TestCategory!=NEEDS_GEOM_LIB" --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DynamoSamples\TestResults - name: Upload build artifact - uses: actions/upload-artifact@v4.6.2 + uses: actions/upload-artifact@v5.0.0 with: name: DynamoSamples path: ${{ github.workspace }}\DynamoSamples\dynamo_package retention-days: 7 - name: Upload test artifact - uses: actions/upload-artifact@v4.6.2 + uses: actions/upload-artifact@v5.0.0 with: name: TestResults path: ${{ github.workspace }}\DynamoSamples\TestResults