Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable package node migration for Dynamo Core 2.0+ graphs #9306

Merged
merged 17 commits into from Dec 17, 2018
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/DynamoCore/Graph/Workspaces/SerializationConverters.cs
Expand Up @@ -169,7 +169,16 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
else if (typeof(DSFunctionBase).IsAssignableFrom(type))
{
var mangledName = obj["FunctionSignature"].Value<string>();
var functionDescriptor = libraryServices.GetFunctionDescriptor(mangledName);
var priorNames = libraryServices.GetPriorNames();
FunctionDescriptor functionDescriptor;

// Attempt to located a newer migrated version of the node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sic(locate)?

if (priorNames.ContainsKey(mangledName))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use TryGetValue . You can check for the key and get the value at the key at the same time.

{ functionDescriptor = libraryServices.GetFunctionDescriptor(priorNames[mangledName]); }
else
{ functionDescriptor = null; }

// Use the functionDescriptor to try and restore the proper node if possible
if (functionDescriptor == null)
{
node = CreateDummyNode(obj, assemblyLocation, inPorts, outPorts);
Expand Down