You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR adds a new ExtensionStorage interface which can be implemented on Extensions and ViewExtension to give the author of the extension the possibility to store extension data directly in the DYN file.
The interface adds two new methods OnWorkspaceOpen and OnWorkspaceSaving which are triggered when a graph is opened and when its saved. Both methods passes a Dictionary<string,string> which can be used to store extension data in, OnWorkspaceSaving also passes a SaveContext so the implementer can react to different save contexts (i.e. save, save as).
The WorkspaceModel stores a collection of ExtensionData objects which is serialized to the DYN file on save. The OnWorkspaceOpen passes a copy of the extension data dictionary therefor modifications done to this will not be reflected in the ExtensionData object (FYI @saintentropy). OnWorkspaceSaving passes a direct reference to the ExtensionData objects dictionary and there for modification made to this will be reflected in the DYN file.
TODO
Determine the max size of the dictionary stored in the DYN file
SHKnudsen
changed the title
Support persisting extension and view extension data
[AGD-1799] Support persisting extension and view extension data
Dec 9, 2020
@SHKnudsen there are around ~80 test failures in the last build - I'll kick it off again incase it's a fluke, but you may want to take a look at the PR test validation link above.
@mjkkirschner Yea looking at it now, i get the same locally. It looks like it might be something with the migration of some old test dyn files, which feels a bit weird.
@mjkkirschner you where right, the test was failing because we are now adding a ExtensionWorkspaceData property on save. Im ignoring that property when comparing the two json files in the test, so that should be fixed now.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This PR adds a new ExtensionStorage interface which can be implemented on
Extensions
andViewExtension
to give the author of the extension the possibility to store extension data directly in the DYN file.The interface adds two new methods
OnWorkspaceOpen
andOnWorkspaceSaving
which are triggered when a graph is opened and when its saved. Both methods passes aDictionary<string,string>
which can be used to store extension data in,OnWorkspaceSaving
also passes aSaveContext
so the implementer can react to different save contexts (i.e. save, save as).The
WorkspaceModel
stores a collection ofExtensionData
objects which is serialized to the DYN file on save. TheOnWorkspaceOpen
passes a copy of the extension data dictionary therefor modifications done to this will not be reflected in theExtensionData
object (FYI @saintentropy).OnWorkspaceSaving
passes a direct reference to theExtensionData
objects dictionary and there for modification made to this will be reflected in the DYN file.TODO
ExtensionData
modelDeclarations
Check these if you believe they are true
*.resx
filesReviewers
@saintentropy
@nate-peters
FYIs
@mjkkirschner
@QilongTang