From 0601ecda0183aa0ff640e1621c51f6fa7a6717b1 Mon Sep 17 00:00:00 2001 From: pinzart Date: Mon, 11 Dec 2023 10:03:43 -0500 Subject: [PATCH 01/11] update --- src/Config/CS.props | 54 ++++- src/SampleExtension/SampleExtension.csproj | 154 +------------ src/SampleExtension/app.config | 15 -- src/SampleExtension/packages.config | 16 -- .../SampleIntegration.csproj | 58 +---- .../HelloDynamoSystemTests.cs | 2 +- .../SampleLibraryTests.csproj | 155 +------------ .../TestServices.dll.config | 7 - src/SampleLibraryTests/app.config | 23 -- src/SampleLibraryTests/packages.config | 16 -- src/SampleLibraryUI/SampleLibraryUI.csproj | 207 +----------------- src/SampleLibraryUI/app.config | 23 -- src/SampleLibraryUI/packages.config | 16 -- .../Examples/BasicExample.cs | 1 - .../Examples/PeriodicUpdateExample.cs | 8 +- .../Examples/TraceExample.cs | 20 +- .../SampleLibraryZeroTouch.csproj | 160 +------------- src/SampleLibraryZeroTouch/packages.config | 15 -- src/SampleLinter/SampleLinter.csproj | 85 ++----- src/SampleLinter/app.config | 15 -- .../SampleViewExtension.csproj | 173 +-------------- src/SampleViewExtension/app.config | 15 -- src/SampleViewExtension/packages.config | 16 -- 23 files changed, 121 insertions(+), 1133 deletions(-) delete mode 100644 src/SampleExtension/app.config delete mode 100644 src/SampleExtension/packages.config 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/src/Config/CS.props b/src/Config/CS.props index e981e9b..b0ce0ab 100644 --- a/src/Config/CS.props +++ b/src/Config/CS.props @@ -1,14 +1,44 @@ - - - - - + - $(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 + 16.0 + net8.0 + 512 + win-x64 + 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..7609e2e 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -1,157 +1,17 @@ - - - + + + + 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 - - - - - - - - - + - + - - \ 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..72284ae 100644 --- a/src/SampleIntegration/SampleIntegration.csproj +++ b/src/SampleIntegration/SampleIntegration.csproj @@ -1,60 +1,10 @@ - - - + + + + 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/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..4d876e1 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -1,161 +1,20 @@ - - - + - + 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/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..9b6a4bd 100644 --- a/src/SampleLibraryUI/SampleLibraryUI.csproj +++ b/src/SampleLibraryUI/SampleLibraryUI.csproj @@ -1,194 +1,15 @@ - - - + - + - 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 + en-US + 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,17 +20,11 @@ - - - - - - - - - - - + + + + + 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..a2d2a2e 100644 --- a/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs +++ b/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs @@ -18,7 +18,7 @@ public class PeriodicUpdateExample : IGraphicItem private const int width = 20; private const int length = 20; - private PeriodicUpdateExample(double t, int id) + private PeriodicUpdateExample(double t, string id) { vertexCoords = new Point[width, length]; @@ -53,7 +53,7 @@ public static PeriodicUpdateExample PointField() var traceId = TraceableObjectManager.GetObjectIdFromTrace(); var t = 0.0; - int id; + string id; if (traceId == null) { // If there's no id stored in trace for this object, @@ -64,8 +64,8 @@ public static PeriodicUpdateExample PointField() { // If there's and id stored in trace, then retrieve the object stored // with that id from the trace object manager. - id = traceId.IntID; - t = (double)TraceableObjectManager.GetTracedObjectById(traceId.IntID); + id = traceId; + t = (double)TraceableObjectManager.GetTracedObjectById(traceId); } return new PeriodicUpdateExample(t, id); diff --git a/src/SampleLibraryZeroTouch/Examples/TraceExample.cs b/src/SampleLibraryZeroTouch/Examples/TraceExample.cs index 600dee4..b038eca 100644 --- a/src/SampleLibraryZeroTouch/Examples/TraceExample.cs +++ b/src/SampleLibraryZeroTouch/Examples/TraceExample.cs @@ -56,7 +56,7 @@ public static TraceExampleItem ByString(string description) TraceExampleItem item = null; - int id; + string id; if (traceId == null) { // If there's no id stored in trace for this object, @@ -74,7 +74,7 @@ public static TraceExampleItem ByString(string description) { // If there's and id stored in trace, then retrieve the object stored // with that id from the trace object manager. - item = (TraceExampleItem)TraceableObjectManager.GetTracedObjectById(traceId.IntID) + item = (TraceExampleItem)TraceableObjectManager.GetTracedObjectById(traceId) ?? new TraceExampleItem(description); // Update the item @@ -104,28 +104,28 @@ public class TraceableObjectManager private static int id = 0; - public static int GetNextUnusedID() + public static string GetNextUnusedID() { var next = id; id++; - return next; + return $"{next}"; } - private static Dictionary traceableObjectManager = new Dictionary(); + private static Dictionary traceableObjectManager = new Dictionary(); - public static TraceableId GetObjectIdFromTrace() + public static string GetObjectIdFromTrace() { - return TraceUtils.GetTraceData(REVIT_TRACE_ID) as TraceableId; + return TraceUtils.GetTraceData(REVIT_TRACE_ID); } - public static object GetTracedObjectById(int id) + public static object GetTracedObjectById(string id) { object ret; traceableObjectManager.TryGetValue(id, out ret); return ret; } - public static void RegisterTraceableObjectForId(int id, object objectToTrace) + public static void RegisterTraceableObjectForId(string id, object objectToTrace) { if (traceableObjectManager.ContainsKey(id)) { @@ -134,7 +134,7 @@ 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, id); } } diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index 343295e..e5eb46e 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -1,166 +1,22 @@ - - - + - + - Debug - AnyCPU - {BD13C4DC-9045-4E49-B637-B6182B0E3A7F} - Library Properties SampleLibraryZeroTouch SampleLibraryZeroTouch - v4.8 - 512 - + 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 - - - - - - - - - - - - - - - - - - - - - - - - + + + + + \ No newline at end of file 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..3e58a6c 100644 --- a/src/SampleLinter/SampleLinter.csproj +++ b/src/SampleLinter/SampleLinter.csproj @@ -1,7 +1,8 @@  + + + - {5F559FDB-99B9-4F4A-9A91-C9EC94C771D8} - net48 SampleLinter SampleLinter Copyright © 2023 @@ -9,74 +10,28 @@ 2.0.1.0 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..e596a12 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -1,170 +1,18 @@ - - - + - + - 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 +21,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 d987164202e0d44841306d46f0975719059e97af Mon Sep 17 00:00:00 2001 From: pinzart Date: Mon, 11 Dec 2023 16:20:33 -0500 Subject: [PATCH 02/11] update --- src/SampleLibraryTests/SampleLibraryTests.csproj | 11 ++++++++++- src/SampleLibraryTests/TestServices.dll.config | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/SampleLibraryTests/TestServices.dll.config diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index 4d876e1..1e65452 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -7,7 +7,8 @@ SampleLibraryTests SampleLibraryTests net8.0-windows - true + en-US + true @@ -16,5 +17,13 @@ + + + + + + + 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..4ce7af6 --- /dev/null +++ b/src/SampleLibraryTests/TestServices.dll.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From ace1fc809b5e7924ba6783ddcea56a02448792af Mon Sep 17 00:00:00 2001 From: pinzart Date: Tue, 12 Dec 2023 09:30:45 -0500 Subject: [PATCH 03/11] update --- .github/dependabot.yml | 8 +++ .../workflows/build_dynamo_samples_net8.0.yml | 50 +++++++++++++++++++ appveyor.yml | 14 ------ 3 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build_dynamo_samples_net8.0.yml delete mode 100644 appveyor.yml 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..1c129be --- /dev/null +++ b/.github/workflows/build_dynamo_samples_net8.0.yml @@ -0,0 +1,50 @@ +# 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 windows runtime + run: | + dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.All.sln /p:Configuration=Release --runtime=win-x64 -p:DotNet=net8.0 + - 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 /p:DotNet=net8.0 + # look for Dynamo + - name: Navigate to DynamoSamples Folder + run: | + cd "$Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleExtension\bin\Release" + echo "***Locating SampleExtension.dll for Windows!***" + test ".\SampleExtension.dll" && echo "SampleExtension.dll exists!" + - name: Save Pull Request Number + env: + PR_NUMBER: ${{ github.event.number }} + run: $env:PR_NUMBER | Out-File -FilePath pr_number.txt + - name: Upload Pull Request Artifact + uses: actions/upload-artifact@v3 + with: + name: pr_number + path: ${{ github.workspace }}\pr_number.txt + if-no-files-found: warn + retention-days: 3 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 From 2735322cf313fdd5ba91c327e95f8e45ba52faea Mon Sep 17 00:00:00 2001 From: pinzart Date: Tue, 12 Dec 2023 10:06:32 -0500 Subject: [PATCH 04/11] update --- .../workflows/build_dynamo_samples_net8.0.yml | 22 ++++++++++++++----- src/SampleExtension/SampleExtension.csproj | 4 +++- src/SampleLibraryUI/SampleLibraryUI.csproj | 4 ++-- .../SampleLibraryZeroTouch.csproj | 13 ++++++----- .../SampleViewExtension.csproj | 7 +++++- 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_dynamo_samples_net8.0.yml b/.github/workflows/build_dynamo_samples_net8.0.yml index 1c129be..06998a5 100644 --- a/.github/workflows/build_dynamo_samples_net8.0.yml +++ b/.github/workflows/build_dynamo_samples_net8.0.yml @@ -25,18 +25,28 @@ jobs: - name: Install dependencies for windows runtime run: | - dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.All.sln /p:Configuration=Release --runtime=win-x64 -p:DotNet=net8.0 + dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release --runtime=win-x64 -p:DotNet=net8.0 - 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 /p:DotNet=net8.0 - # look for Dynamo - - name: Navigate to DynamoSamples Folder + # look for DynamoSamples outputs + - name: Navigate to dynamo_linter Folder run: | - cd "$Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleExtension\bin\Release" - echo "***Locating SampleExtension.dll for Windows!***" - test ".\SampleExtension.dll" && echo "SampleExtension.dll exists!" + 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!" - name: Save Pull Request Number env: PR_NUMBER: ${{ github.event.number }} diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index 7609e2e..b6a380c 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -9,7 +9,9 @@ true - + + Always + diff --git a/src/SampleLibraryUI/SampleLibraryUI.csproj b/src/SampleLibraryUI/SampleLibraryUI.csproj index 9b6a4bd..9b56923 100644 --- a/src/SampleLibraryUI/SampleLibraryUI.csproj +++ b/src/SampleLibraryUI/SampleLibraryUI.csproj @@ -25,9 +25,9 @@ - + - + diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index e5eb46e..6171edb 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -8,15 +8,16 @@ SampleLibraryZeroTouch bin\$(Configuration)\SampleLibraryZeroTouch.XML - - - - - - + + + + + + + \ No newline at end of file diff --git a/src/SampleViewExtension/SampleViewExtension.csproj b/src/SampleViewExtension/SampleViewExtension.csproj index e596a12..45d6838 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -13,7 +13,12 @@ - + + + Always + + + From 289c2af4bd1ff506102144a9735fd9d4e946c352 Mon Sep 17 00:00:00 2001 From: pinzart Date: Tue, 12 Dec 2023 10:54:03 -0500 Subject: [PATCH 05/11] Create Setup.cs --- src/SampleLibraryTests/Setup.cs | 88 +++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 src/SampleLibraryTests/Setup.cs diff --git a/src/SampleLibraryTests/Setup.cs b/src/SampleLibraryTests/Setup.cs new file mode 100644 index 0000000..8462e67 --- /dev/null +++ b/src/SampleLibraryTests/Setup.cs @@ -0,0 +1,88 @@ +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 culture specific resources + Path.Combine(moduleRootFolder, CultureInfo.CurrentUICulture.Name), + // Search for nodes + Path.Combine(moduleRootFolder, "nodes"), + // Search for culture specific node resources + Path.Combine(moduleRootFolder, "nodes", CultureInfo.CurrentUICulture.Name) + }; + 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; + } +} From 8ffe71c6d0985d7b6be3e0e7b610b52cf4c729e4 Mon Sep 17 00:00:00 2001 From: pinzart Date: Tue, 12 Dec 2023 20:11:33 -0500 Subject: [PATCH 06/11] update trace --- .../workflows/build_dynamo_samples_net8.0.yml | 15 +++++++++++- .../SampleIntegration.csproj | 6 +++-- src/SampleIntegration/TracedHog.cs | 9 ++++--- .../TestServices.dll.config | 2 +- .../Examples/TraceExample.cs | 24 ++++++++++--------- 5 files changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_dynamo_samples_net8.0.yml b/.github/workflows/build_dynamo_samples_net8.0.yml index 06998a5..5771ada 100644 --- a/.github/workflows/build_dynamo_samples_net8.0.yml +++ b/.github/workflows/build_dynamo_samples_net8.0.yml @@ -22,7 +22,20 @@ jobs: 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 -p:DotNet=net8.0 + - 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 /p:DotNet=net8.0 + # look for DynamoSamples outputs + - name: Navigate to dynamo_linter 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 -p:DotNet=net8.0 diff --git a/src/SampleIntegration/SampleIntegration.csproj b/src/SampleIntegration/SampleIntegration.csproj index 72284ae..e8d5ac6 100644 --- a/src/SampleIntegration/SampleIntegration.csproj +++ b/src/SampleIntegration/SampleIntegration.csproj @@ -1,10 +1,12 @@  - + - Debug SampleIntegration SampleIntegration + + + \ 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/TestServices.dll.config b/src/SampleLibraryTests/TestServices.dll.config index 4ce7af6..47bc598 100644 --- a/src/SampleLibraryTests/TestServices.dll.config +++ b/src/SampleLibraryTests/TestServices.dll.config @@ -1,7 +1,7 @@  - + \ No newline at end of file diff --git a/src/SampleLibraryZeroTouch/Examples/TraceExample.cs b/src/SampleLibraryZeroTouch/Examples/TraceExample.cs index b038eca..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 { @@ -56,7 +57,7 @@ public static TraceExampleItem ByString(string description) TraceExampleItem item = null; - string id; + int id; if (traceId == null) { // If there's no id stored in trace for this object, @@ -74,7 +75,7 @@ public static TraceExampleItem ByString(string description) { // If there's and id stored in trace, then retrieve the object stored // with that id from the trace object manager. - item = (TraceExampleItem)TraceableObjectManager.GetTracedObjectById(traceId) + item = (TraceExampleItem)TraceableObjectManager.GetTracedObjectById(traceId.IntID) ?? new TraceExampleItem(description); // Update the item @@ -104,28 +105,28 @@ public class TraceableObjectManager private static int id = 0; - public static string GetNextUnusedID() + public static int GetNextUnusedID() { var next = id; id++; - return $"{next}"; + return next; } - private static Dictionary traceableObjectManager = new Dictionary(); + private static Dictionary traceableObjectManager = new Dictionary(); - public static string GetObjectIdFromTrace() + public static TraceableId GetObjectIdFromTrace() { - return TraceUtils.GetTraceData(REVIT_TRACE_ID); + return JsonConvert.DeserializeObject(TraceUtils.GetTraceData(REVIT_TRACE_ID)); } - public static object GetTracedObjectById(string id) + public static object GetTracedObjectById(int id) { object ret; traceableObjectManager.TryGetValue(id, out ret); return ret; } - public static void RegisterTraceableObjectForId(string id, object objectToTrace) + public static void RegisterTraceableObjectForId(int id, object objectToTrace) { if (traceableObjectManager.ContainsKey(id)) { @@ -134,7 +135,8 @@ public static void RegisterTraceableObjectForId(string id, object objectToTrace) else { traceableObjectManager.Add(id, objectToTrace); - TraceUtils.SetTraceData(REVIT_TRACE_ID, 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 From be1ceb3e644e089ca7ca158f5fe9b4cc025235fe Mon Sep 17 00:00:00 2001 From: pinzart Date: Tue, 12 Dec 2023 21:01:36 -0500 Subject: [PATCH 07/11] Update PeriodicUpdateExample.cs --- .../Examples/PeriodicUpdateExample.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs b/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs index a2d2a2e..4458e08 100644 --- a/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs +++ b/src/SampleLibraryZeroTouch/Examples/PeriodicUpdateExample.cs @@ -12,13 +12,13 @@ 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; private const int length = 20; - private PeriodicUpdateExample(double t, string id) + private PeriodicUpdateExample(double t, int id) { vertexCoords = new Point[width, length]; @@ -32,7 +32,7 @@ private PeriodicUpdateExample(double t, string 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. @@ -53,7 +53,7 @@ public static PeriodicUpdateExample PointField() var traceId = TraceableObjectManager.GetObjectIdFromTrace(); var t = 0.0; - string id; + int id; if (traceId == null) { // If there's no id stored in trace for this object, @@ -64,8 +64,8 @@ public static PeriodicUpdateExample PointField() { // If there's and id stored in trace, then retrieve the object stored // with that id from the trace object manager. - id = traceId; - t = (double)TraceableObjectManager.GetTracedObjectById(traceId); + id = traceId.IntID; + t = (double)TraceableObjectManager.GetTracedObjectById(traceId.IntID); } return new PeriodicUpdateExample(t, id); @@ -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 From 0875f6c9e26e441ba303c10504964442487d4db3 Mon Sep 17 00:00:00 2001 From: pinzart Date: Fri, 22 Dec 2023 13:36:15 -0500 Subject: [PATCH 08/11] update --- .github/workflows/build_dynamo_samples_net8.0.yml | 13 +------------ src/SampleLibraryTests/SampleLibraryTests.csproj | 10 +--------- src/SampleLibraryTests/TestServices.dll.config | 7 ------- 3 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 src/SampleLibraryTests/TestServices.dll.config diff --git a/.github/workflows/build_dynamo_samples_net8.0.yml b/.github/workflows/build_dynamo_samples_net8.0.yml index 5771ada..8615b8b 100644 --- a/.github/workflows/build_dynamo_samples_net8.0.yml +++ b/.github/workflows/build_dynamo_samples_net8.0.yml @@ -31,7 +31,7 @@ jobs: 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 /p:DotNet=net8.0 # look for DynamoSamples outputs - - name: Navigate to dynamo_linter Folder + - name: Navigate to SampleIntegration Folder run: | cd "$Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\bin\Release" echo "***Locating SampleIntegration.dll for Windows!***" @@ -60,14 +60,3 @@ jobs: cd "$Env:GITHUB_WORKSPACE\DynamoSamples\dynamo_viewExtension\Sample View Extension\bin" echo "***Locating SampleViewExtension.dll for Windows!***" test ".\SampleViewExtension.dll" && echo "SampleViewExtension.dll exists!" - - name: Save Pull Request Number - env: - PR_NUMBER: ${{ github.event.number }} - run: $env:PR_NUMBER | Out-File -FilePath pr_number.txt - - name: Upload Pull Request Artifact - uses: actions/upload-artifact@v3 - with: - name: pr_number - path: ${{ github.workspace }}\pr_number.txt - if-no-files-found: warn - retention-days: 3 diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index 1e65452..1c31d18 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -16,14 +16,6 @@ - - - - - - - - Always - + \ No newline at end of file diff --git a/src/SampleLibraryTests/TestServices.dll.config b/src/SampleLibraryTests/TestServices.dll.config deleted file mode 100644 index 47bc598..0000000 --- a/src/SampleLibraryTests/TestServices.dll.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file From 397a25e07eb021f7dcd3b9e8f939212a99adfb27 Mon Sep 17 00:00:00 2001 From: pinzart90 Date: Tue, 2 Jan 2024 23:01:03 -0500 Subject: [PATCH 09/11] Update Setup.cs --- src/SampleLibraryTests/Setup.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/SampleLibraryTests/Setup.cs b/src/SampleLibraryTests/Setup.cs index 8462e67..c787f75 100644 --- a/src/SampleLibraryTests/Setup.cs +++ b/src/SampleLibraryTests/Setup.cs @@ -38,12 +38,8 @@ public void RunBeforeAllTests() resolutionPaths = new List { - // Search for culture specific resources - Path.Combine(moduleRootFolder, CultureInfo.CurrentUICulture.Name), // Search for nodes - Path.Combine(moduleRootFolder, "nodes"), - // Search for culture specific node resources - Path.Combine(moduleRootFolder, "nodes", CultureInfo.CurrentUICulture.Name) + Path.Combine(moduleRootFolder, "nodes") }; AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; ; } From d8c00b9a3c4a7077679dd8952b60ccbafc382e55 Mon Sep 17 00:00:00 2001 From: pinzart90 Date: Mon, 8 Jan 2024 11:11:54 -0500 Subject: [PATCH 10/11] update --- .github/workflows/build_dynamo_samples_net8.0.yml | 8 ++++---- src/Config/CS.props | 4 +--- src/SampleExtension/SampleExtension.csproj | 4 +++- src/SampleLibraryTests/SampleLibraryTests.csproj | 4 ++-- src/SampleLibraryUI/SampleLibraryUI.csproj | 11 +++++++---- .../SampleLibraryZeroTouch.csproj | 9 ++++++--- src/SampleLinter/SampleLinter.csproj | 9 ++++++--- src/SampleViewExtension/SampleViewExtension.csproj | 1 + 8 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_dynamo_samples_net8.0.yml b/.github/workflows/build_dynamo_samples_net8.0.yml index 8615b8b..1d35049 100644 --- a/.github/workflows/build_dynamo_samples_net8.0.yml +++ b/.github/workflows/build_dynamo_samples_net8.0.yml @@ -24,12 +24,12 @@ jobs: 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 -p:DotNet=net8.0 + 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 /p:DotNet=net8.0 + .\MSBuild.exe $Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release # look for DynamoSamples outputs - name: Navigate to SampleIntegration Folder run: | @@ -38,12 +38,12 @@ jobs: 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 -p:DotNet=net8.0 + 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 /p:DotNet=net8.0 + .\MSBuild.exe $Env:GITHUB_WORKSPACE\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release # look for DynamoSamples outputs - name: Navigate to dynamo_linter Folder run: | diff --git a/src/Config/CS.props b/src/Config/CS.props index b0ce0ab..07ee8e9 100644 --- a/src/Config/CS.props +++ b/src/Config/CS.props @@ -3,10 +3,8 @@ Debug AnyCPU x64 - 16.0 net8.0 512 - win-x64 false false prompt @@ -21,7 +19,7 @@ full - + true full diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index b6a380c..a0c9b66 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -6,6 +6,8 @@ Debug SampleExtension SampleExtension + + true @@ -14,6 +16,6 @@ - + \ No newline at end of file diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index 1c31d18..c6b3d4e 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -6,8 +6,8 @@ Debug SampleLibraryTests SampleLibraryTests + net8.0-windows - en-US true @@ -16,6 +16,6 @@ - + \ No newline at end of file diff --git a/src/SampleLibraryUI/SampleLibraryUI.csproj b/src/SampleLibraryUI/SampleLibraryUI.csproj index 9b56923..b39c5ef 100644 --- a/src/SampleLibraryUI/SampleLibraryUI.csproj +++ b/src/SampleLibraryUI/SampleLibraryUI.csproj @@ -5,9 +5,12 @@ SampleLibraryUI SampleLibraryUI + net8.0-windows true - en-US + + + true bin\$(Configuration)\$(UICulture)\SampleLibraryUI.XML @@ -21,9 +24,9 @@ - - - + + + diff --git a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj index 6171edb..439b56b 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -6,12 +6,15 @@ Properties SampleLibraryZeroTouch SampleLibraryZeroTouch + + + true bin\$(Configuration)\SampleLibraryZeroTouch.XML - - - + + + diff --git a/src/SampleLinter/SampleLinter.csproj b/src/SampleLinter/SampleLinter.csproj index 3e58a6c..799cc2a 100644 --- a/src/SampleLinter/SampleLinter.csproj +++ b/src/SampleLinter/SampleLinter.csproj @@ -8,12 +8,15 @@ Copyright © 2023 2.0.1.0 2.0.1.0 + + + true bin\$(Configuration)\ - - - + + + diff --git a/src/SampleViewExtension/SampleViewExtension.csproj b/src/SampleViewExtension/SampleViewExtension.csproj index 45d6838..b2cae0f 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -5,6 +5,7 @@ SampleViewExtension SampleViewExtension + net8.0-windows true From c74dad8588fc203b5f8fc0b408191821f0d80bdb Mon Sep 17 00:00:00 2001 From: pinzart90 Date: Thu, 11 Jan 2024 15:30:53 -0500 Subject: [PATCH 11/11] update --- src/SampleExtension/SampleExtension.csproj | 2 +- src/SampleLibraryTests/SampleLibraryTests.csproj | 2 +- src/SampleLibraryUI/SampleLibraryUI.csproj | 6 +++--- src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj | 6 +++--- src/SampleLinter/SampleLinter.csproj | 6 +++--- src/SampleViewExtension/SampleViewExtension.csproj | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/SampleExtension/SampleExtension.csproj b/src/SampleExtension/SampleExtension.csproj index a0c9b66..fb4c133 100644 --- a/src/SampleExtension/SampleExtension.csproj +++ b/src/SampleExtension/SampleExtension.csproj @@ -16,6 +16,6 @@ - + \ No newline at end of file diff --git a/src/SampleLibraryTests/SampleLibraryTests.csproj b/src/SampleLibraryTests/SampleLibraryTests.csproj index c6b3d4e..b4c12e0 100644 --- a/src/SampleLibraryTests/SampleLibraryTests.csproj +++ b/src/SampleLibraryTests/SampleLibraryTests.csproj @@ -16,6 +16,6 @@ - + \ No newline at end of file diff --git a/src/SampleLibraryUI/SampleLibraryUI.csproj b/src/SampleLibraryUI/SampleLibraryUI.csproj index b39c5ef..229eba6 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 439b56b..f18e7c4 100644 --- a/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj +++ b/src/SampleLibraryZeroTouch/SampleLibraryZeroTouch.csproj @@ -12,9 +12,9 @@ bin\$(Configuration)\SampleLibraryZeroTouch.XML - - - + + + diff --git a/src/SampleLinter/SampleLinter.csproj b/src/SampleLinter/SampleLinter.csproj index 799cc2a..bb592fc 100644 --- a/src/SampleLinter/SampleLinter.csproj +++ b/src/SampleLinter/SampleLinter.csproj @@ -14,9 +14,9 @@ bin\$(Configuration)\ - - - + + + diff --git a/src/SampleViewExtension/SampleViewExtension.csproj b/src/SampleViewExtension/SampleViewExtension.csproj index b2cae0f..a2b6881 100644 --- a/src/SampleViewExtension/SampleViewExtension.csproj +++ b/src/SampleViewExtension/SampleViewExtension.csproj @@ -10,9 +10,9 @@ true - - - + + +