Skip to content

Commit 085fb51

Browse files
committed
2 parents d055de4 + 615c080 commit 085fb51

32 files changed

+4065
-97
lines changed

src/DynamoCore/DynamoCore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ limitations under the License.
7878
<Reference Include="Analytics.NET.Google">
7979
<HintPath>..\..\extern\Analytics.NET\Analytics.NET.Google.dll</HintPath>
8080
</Reference>
81-
<Reference Include="Greg, Version=1.1.6907.32055, Culture=neutral, processorArchitecture=MSIL">
82-
<HintPath>..\packages\Greg.1.1.6907.32055\lib\net45\Greg.dll</HintPath>
81+
<Reference Include="Greg, Version=1.1.6913.31484, Culture=neutral, processorArchitecture=MSIL">
82+
<HintPath>..\packages\Greg.1.1.6913.31484\lib\net47\Greg.dll</HintPath>
8383
</Reference>
8484
<Reference Include="Microsoft.CSharp" />
8585
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">

src/DynamoCore/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Greg" version="1.1.6907.32055" targetFramework="net47" />
3+
<package id="Greg" version="1.1.6913.31484" targetFramework="net47" />
44
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
55
<package id="RestSharp" version="105.2.3" targetFramework="net47" />
66
</packages>

src/DynamoCoreWpf/Commands/WorkspaceCommands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public bool IsGeometryOperationEnabled
265265
return false; // No selection.
266266

267267
// Menu options that are specific to geometry (show/hide all
268-
// geometry previews, upstream previews, etc.) are only enabled
268+
// geometry previews, etc.) are only enabled
269269
// in the home workspace.
270270
//
271271
return (this.Model is HomeWorkspaceModel);

src/DynamoCoreWpf/DynamoCoreWpf.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
<Reference Include="FontAwesome.WPF">
5151
<HintPath>..\..\extern\FontAwesome\FontAwesome.WPF.dll</HintPath>
5252
</Reference>
53-
<Reference Include="Greg, Version=1.1.6907.32055, Culture=neutral, processorArchitecture=MSIL">
54-
<HintPath>..\packages\Greg.1.1.6907.32055\lib\net45\Greg.dll</HintPath>
53+
<Reference Include="Greg, Version=1.1.6913.31484, Culture=neutral, processorArchitecture=MSIL">
54+
<HintPath>..\packages\Greg.1.1.6913.31484\lib\net47\Greg.dll</HintPath>
5555
</Reference>
5656
<Reference Include="HelixToolkit, Version=2015.1.629.0, Culture=neutral, PublicKeyToken=52aa3500039caf0d, processorArchitecture=MSIL">
5757
<HintPath>..\packages\HelixToolkit.2015.1.629\lib\portable-net4+sl4+wp71+win8\HelixToolkit.dll</HintPath>

src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

src/DynamoCoreWpf/Properties/Resources.en-US.resx

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,6 @@
285285
<value>Hide all text bubble</value>
286286
<comment>Context menu item - Specific to canvas</comment>
287287
</data>
288-
<data name="ContextMenuHideUpstreamPreview" xml:space="preserve">
289-
<value>Hide upstream geometry preview</value>
290-
<comment>Context menu item - Specific to canvas</comment>
291-
</data>
292288
<data name="ContextMenuInsertCodeBlock" xml:space="preserve">
293289
<value>Insert code block</value>
294290
<comment>Context menu item - Specific to canvas</comment>
@@ -349,10 +345,6 @@
349345
<value>Show all text buble</value>
350346
<comment>Context menu item - Specific to canvas</comment>
351347
</data>
352-
<data name="ContextMenuShowUpstreamPreview" xml:space="preserve">
353-
<value>Show upstream geometry preview</value>
354-
<comment>Context menu item - Specific to canvas</comment>
355-
</data>
356348
<data name="ContextUnGroupFromSelection" xml:space="preserve">
357349
<value>Remove from Group</value>
358350
<comment>Context menu item</comment>
@@ -881,7 +873,7 @@ It does not contain your graph or any personal data</value>
881873
<comment>Settings menu | Geometry Scaling</comment>
882874
</data>
883875
<data name="DynamoViewSettingsMenuIsolationMode" xml:space="preserve">
884-
<value>Isolate Selected Geometries</value>
876+
<value>Isolate Selected Geometry</value>
885877
</data>
886878
<data name="DynamoViewSettingsMenuShowEdges" xml:space="preserve">
887879
<value>Show Edges</value>
@@ -1459,10 +1451,6 @@ Uninstall the following dependent packages: {1}?</value>
14591451
<value>Preview</value>
14601452
<comment>Context menu item - preview geometry</comment>
14611453
</data>
1462-
<data name="NodeContextMenuPreviewUpstream" xml:space="preserve">
1463-
<value>Preview Upstream</value>
1464-
<comment>Context menu item - preview geometry of upstream nodes</comment>
1465-
</data>
14661454
<data name="NodeContextMenuRenameNode" xml:space="preserve">
14671455
<value>Rename Node...</value>
14681456
<comment>Context menu item - rename this node</comment>
@@ -1623,10 +1611,10 @@ Next assemblies were loaded several times:
16231611
<value>Package Path Added</value>
16241612
</data>
16251613
<data name="PackagePathAutoAddNotificationShortDescription" xml:space="preserve">
1626-
<value>A library (*.dll, *.ds) was recently imported into Dynamo. Its path was automatically added to "Settings > Manage Node and Package Paths..."</value>
1614+
<value>A library (*.dll, *.ds) was recently imported into Dynamo. Its path was automatically added to "Settings &gt; Manage Node and Package Paths..."</value>
16271615
</data>
16281616
<data name="PackagePathAutoAddNotificationDetailedDescription" xml:space="preserve">
1629-
<value>The import path "{0}" was added to "Manage Node and Package Paths". If you want to update or remove this path, please open "Settings > Manage Node and Package Paths..."</value>
1617+
<value>The import path "{0}" was added to "Manage Node and Package Paths". If you want to update or remove this path, please open "Settings &gt; Manage Node and Package Paths..."</value>
16301618
</data>
16311619
<data name="PackageSearchStateNoResult" xml:space="preserve">
16321620
<value>Search returned no results!</value>
@@ -1859,9 +1847,6 @@ Want to publish a different package?</value>
18591847
<data name="PublishPackageViewPackageVersion" xml:space="preserve">
18601848
<value>Version (major minor build)</value>
18611849
</data>
1862-
<data name="DynamoViewSettingsMenuIsolationMode" xml:space="preserve">
1863-
<value>Isolate Selected Geometry</value>
1864-
</data>
18651850
<data name="PublishPackageViewPackageVersionTooltip" xml:space="preserve">
18661851
<value>A version name helps a submitter keep track of updates to the package. A new version of a package will be REJECTED if this is not incremeneted.</value>
18671852
</data>

src/DynamoCoreWpf/Properties/Resources.resx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -740,10 +740,6 @@ It does not contain your graph or any personal data</value>
740740
<value>Preview</value>
741741
<comment>Context menu item - preview geometry</comment>
742742
</data>
743-
<data name="NodeContextMenuPreviewUpstream" xml:space="preserve">
744-
<value>Preview Upstream</value>
745-
<comment>Context menu item - preview geometry of upstream nodes</comment>
746-
</data>
747743
<data name="NodeContextMenuRenameNode" xml:space="preserve">
748744
<value>Rename Node...</value>
749745
<comment>Context menu item - rename this node</comment>
@@ -1706,10 +1702,6 @@ Do you want to install the latest Dynamo update?</value>
17061702
<value>Hide all text bubble</value>
17071703
<comment>Context menu item - Specific to canvas</comment>
17081704
</data>
1709-
<data name="ContextMenuHideUpstreamPreview" xml:space="preserve">
1710-
<value>Hide upstream geometry preview</value>
1711-
<comment>Context menu item - Specific to canvas</comment>
1712-
</data>
17131705
<data name="ContextMenuInsertCodeBlock" xml:space="preserve">
17141706
<value>Insert code block</value>
17151707
<comment>Context menu item - Specific to canvas</comment>
@@ -1726,10 +1718,6 @@ Do you want to install the latest Dynamo update?</value>
17261718
<value>Show all text buble</value>
17271719
<comment>Context menu item - Specific to canvas</comment>
17281720
</data>
1729-
<data name="ContextMenuShowUpstreamPreview" xml:space="preserve">
1730-
<value>Show upstream geometry preview</value>
1731-
<comment>Context menu item - Specific to canvas</comment>
1732-
</data>
17331721
<data name="MoreButton" xml:space="preserve">
17341722
<value>More</value>
17351723
<comment>The "More" button on "Publish a Dynamo Package" dialog</comment>
@@ -1965,10 +1953,10 @@ Do you want to install the latest Dynamo update?</value>
19651953
<value>Package Path Added</value>
19661954
</data>
19671955
<data name="PackagePathAutoAddNotificationShortDescription" xml:space="preserve">
1968-
<value>A library (*.dll, *.ds) was recently imported into Dynamo. Its path was automatically added to "Settings > Manage Node and Package Paths..."</value>
1956+
<value>A library (*.dll, *.ds) was recently imported into Dynamo. Its path was automatically added to "Settings &gt; Manage Node and Package Paths..."</value>
19691957
</data>
19701958
<data name="PackagePathAutoAddNotificationDetailedDescription" xml:space="preserve">
1971-
<value>The import path "{0}" was added to "Manage Node and Package Paths". If you want to update or remove this path, please open "Settings > Manage Node and Package Paths..."</value>
1959+
<value>The import path "{0}" was added to "Manage Node and Package Paths". If you want to update or remove this path, please open "Settings &gt; Manage Node and Package Paths..."</value>
19721960
</data>
19731961
<data name="NodeContextMenuIsInput" xml:space="preserve">
19741962
<value>Is Input</value>

src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,6 @@ private void RefreshViewOnSelectionChange(object sender, NotifyCollectionChanged
13791379
RaisePropertyChanged("HasSelection");
13801380
RaisePropertyChanged("IsGeometryOperationEnabled");
13811381
RaisePropertyChanged("AnyNodeVisible");
1382-
RaisePropertyChanged("AnyNodeUpstreamVisible");
13831382
RaisePropertyChanged("SelectionArgumentLacing");
13841383
}
13851384
}

src/DynamoCoreWpf/Views/Core/WorkspaceView.xaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -397,18 +397,6 @@
397397
CommandParameter="false"
398398
Visibility="{Binding Path=AnyNodeVisible, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" />
399399

400-
<MenuItem IsEnabled="{Binding Path=IsGeometryOperationEnabled}"
401-
Header="{x:Static p:Resources.ContextMenuShowUpstreamPreview}"
402-
Command="{Binding Path=ShowHideAllUpstreamPreviewCommand}"
403-
CommandParameter="true"
404-
Visibility="{Binding Path=AnyNodeUpstreamVisible, Converter={StaticResource InverseBoolToVisibilityCollapsedConverter}}" />
405-
406-
<MenuItem IsEnabled="{Binding Path=IsGeometryOperationEnabled}"
407-
Header="{x:Static p:Resources.ContextMenuHideUpstreamPreview}"
408-
Command="{Binding Path=ShowHideAllUpstreamPreviewCommand}"
409-
CommandParameter="false"
410-
Visibility="{Binding Path=AnyNodeUpstreamVisible, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" />
411-
412400
<controls:ParentMenuItem Header="{x:Static p:Resources.DynamoViewEditMenuAlignSelection}" x:Name="Align">
413401
<MenuItem Header="{x:Static p:Resources.DynamoViewEditMenuAlignXAverage}"
414402
Command="{Binding AlignSelectedCommand}"

src/DynamoCoreWpf/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Cyotek.Drawing.BitmapFont" version="1.0.2.0" targetFramework="net45" />
4-
<package id="Greg" version="1.1.6907.32055" targetFramework="net47" />
4+
<package id="Greg" version="1.1.6913.31484" targetFramework="net47" />
55
<package id="HelixToolkit" version="2015.1.629" targetFramework="net45" />
66
<package id="HelixToolkit.Wpf" version="2015.1.629" targetFramework="net45" />
77
<package id="HelixToolkit.Wpf.SharpDX" version="2015.1.629" targetFramework="net45" />

src/DynamoPackages/DynamoPackages.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
<Prefer32Bit>false</Prefer32Bit>
4040
</PropertyGroup>
4141
<ItemGroup>
42-
<Reference Include="Greg, Version=1.1.6907.32055, Culture=neutral, processorArchitecture=MSIL">
43-
<HintPath>..\packages\Greg.1.1.6907.32055\lib\net45\Greg.dll</HintPath>
42+
<Reference Include="Greg, Version=1.1.6913.31484, Culture=neutral, processorArchitecture=MSIL">
43+
<HintPath>..\packages\Greg.1.1.6913.31484\lib\net47\Greg.dll</HintPath>
4444
</Reference>
4545
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4646
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>

src/DynamoPackages/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Greg" version="1.1.6907.32055" targetFramework="net47" />
3+
<package id="Greg" version="1.1.6913.31484" targetFramework="net47" />
44
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
55
<package id="RestSharp" version="105.2.3" targetFramework="net47" />
66
</packages>

src/Libraries/CoreNodes/CoreNodes.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
<Compile Include="Compare.cs" />
7575
<Compile Include="DateTime.cs" />
7676
<Compile Include="FileSystem.cs" />
77+
<Compile Include="Data.cs" />
7778
<Compile Include="List.cs" />
7879
<Compile Include="Math.cs" />
7980
<Compile Include="Object.cs" />

src/Libraries/CoreNodes/Data.cs

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using Autodesk.DesignScript.Runtime;
5+
using Newtonsoft.Json;
6+
using Newtonsoft.Json.Linq;
7+
8+
namespace DSCore
9+
{
10+
public static class Data
11+
{
12+
/// <summary>
13+
/// Parse converts an arbitrary JSON string to a value. It is the opposite of JSON.Stringify.
14+
/// </summary>
15+
/// <param name="json">A JSON string</param>
16+
/// <returns name="result">The result type depends on the content of the input string. The result type can be a primitive value (e.g. string, boolean, double), a List, or a Dictionary.</returns>
17+
public static object ParseJSON(string json)
18+
{
19+
return ToNative(JToken.Parse(json));
20+
}
21+
22+
private static object ToNative(JToken token)
23+
{
24+
switch (token.Type)
25+
{
26+
case JTokenType.Object:
27+
var obj = token as JObject;
28+
var dict = new Dictionary<string, object>();
29+
foreach (var kv in obj)
30+
{
31+
dict[kv.Key] = ToNative(kv.Value);
32+
}
33+
return dict;
34+
case JTokenType.Array:
35+
var arr = token as JArray;
36+
return arr.Select(ToNative);
37+
case JTokenType.Null:
38+
return null;
39+
case JTokenType.Integer:
40+
case JTokenType.Float:
41+
case JTokenType.String:
42+
case JTokenType.Boolean:
43+
case JTokenType.Date:
44+
case JTokenType.TimeSpan:
45+
return (token as JValue).Value;
46+
case JTokenType.Guid:
47+
case JTokenType.Uri:
48+
return (token as JValue).Value.ToString();
49+
default:
50+
return null;
51+
}
52+
}
53+
54+
/// <summary>
55+
/// Stringify converts an arbitrary value or a list of arbitrary values to JSON. Replication can be used to apply the operation over a list, producing a list of JSON strings.
56+
/// </summary>
57+
/// <param name="values">A List of values</param>
58+
/// <returns name="json">A JSON string where primitive types (e.g. double, int, boolean), Lists, and Dictionary's will be turned into the associated JSON type.</returns>
59+
public static string StringifyJSON([ArbitraryDimensionArrayImport] object values)
60+
{
61+
return JsonConvert.SerializeObject(values, new DictConverter());
62+
}
63+
64+
/// <summary>
65+
/// Ensures DesignScript.Builtin.Dictionary's, which deliberately don't implement IDictionary, are transformed into JSON objects.
66+
/// </summary>
67+
private class DictConverter : JsonConverter
68+
{
69+
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
70+
{
71+
object obj;
72+
if (value is DesignScript.Builtin.Dictionary)
73+
{
74+
var dict = value as DesignScript.Builtin.Dictionary;
75+
var rdict = new Dictionary<string, object>();
76+
foreach (var key in dict.Keys)
77+
{
78+
rdict[key] = dict.ValueAtKey(key);
79+
}
80+
obj = rdict;
81+
}
82+
else
83+
{
84+
obj = value;
85+
}
86+
87+
serializer.Serialize(writer, obj);
88+
}
89+
90+
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
91+
{
92+
throw new NotImplementedException("Unnecessary because CanRead is false. The type will skip the converter.");
93+
}
94+
95+
public override bool CanRead
96+
{
97+
get { return false; }
98+
}
99+
100+
public override bool CanConvert(Type objectType)
101+
{
102+
return objectType == typeof(DesignScript.Builtin.Dictionary);
103+
}
104+
}
105+
106+
}
107+
}

src/LibraryViewExtension/LibraryViewExtension.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
<WarningLevel>4</WarningLevel>
3838
</PropertyGroup>
3939
<ItemGroup>
40-
<Reference Include="Greg, Version=1.1.6907.32055, Culture=neutral, processorArchitecture=MSIL">
41-
<HintPath>..\packages\Greg.1.1.6907.32055\lib\net45\Greg.dll</HintPath>
40+
<Reference Include="Greg, Version=1.1.6913.31484, Culture=neutral, processorArchitecture=MSIL">
41+
<HintPath>..\packages\Greg.1.1.6913.31484\lib\net47\Greg.dll</HintPath>
4242
</Reference>
4343
<Reference Include="Microsoft.Practices.Prism, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4444
<SpecificVersion>False</SpecificVersion>

src/LibraryViewExtension/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<package id="cef.redist.x86" version="3.3325.1758" targetFramework="net452" />
55
<package id="CefSharp.Common" version="65.0.1" targetFramework="net452" />
66
<package id="CefSharp.Wpf" version="65.0.1" targetFramework="net452" />
7-
<package id="Greg" version="1.1.6907.32055" targetFramework="net47" />
7+
<package id="Greg" version="1.1.6913.31484" targetFramework="net47" />
88
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
99
<package id="RestSharp" version="105.2.3" targetFramework="net47" />
1010
</packages>

0 commit comments

Comments
 (0)