-
Notifications
You must be signed in to change notification settings - Fork 635
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
[AGD-1799] Support persisting extension and view extension data #11347
[AGD-1799] Support persisting extension and view extension data #11347
Conversation
@@ -33,6 +33,7 @@ public interface IExtensionSource | |||
public class ExtensionManager: IExtensionManager, ILogSource | |||
{ | |||
private readonly List<IExtension> extensions = new List<IExtension>(); | |||
private readonly List<IExtensionStorageAccess> storageAccessExtensions = new List<IExtensionStorageAccess>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use a hashset or dictionary of guid to extensions?
please add tests to your TODO list. |
@saintentropy @mjkkirschner moved this out of |
@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. |
Turned out it was just me that had messed a few |
@SHKnudsen only one failure left 👍
I'm guessing maybe this test needs to ignore the new data you added? |
@mjkkirschner you where right, the test was failing because we are now adding a |
@nate-peters @saintentropy - any other comments? |
Is there scope to add a sample extension to the dynamo samples repo illustrating use of this interface? |
I think i can find some scope to do this, if you guys are happy with that. |
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