Skip to content

Commit

Permalink
update dev view UI when package installed. (DynamoDS#9915)
Browse files Browse the repository at this point in the history
* get rid of properties that were not set
set package loader to update dep UI
add this outisde the view to make it clear this is intended to be a singleton view

* flipped usings
  • Loading branch information
mjkkirschner authored Aug 19, 2019
1 parent 731aeb6 commit 9243c17
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Dynamo.WorkspaceDependency
public class WorkspaceDependencyViewExtension : IViewExtension, ILogSource
{
private MenuItem packageDependencyMenuItem;
private ReadyParams ReadyParams;
private ViewLoadedParams LoadedParams;

internal WorkspaceDependencyView DependencyView
{
Expand Down Expand Up @@ -57,16 +57,16 @@ public void Dispose()
{
}



[Obsolete("This method is not implemented and will be removed.")]
public void Ready(ReadyParams readyParams)
{
ReadyParams = readyParams;
}

public void Shutdown()
{
ReadyParams.CurrentWorkspaceChanged -= DependencyView.OnWorkspaceChanged;
ReadyParams.CurrentWorkspaceCleared -= DependencyView.OnWorkspaceCleared;
LoadedParams.CurrentWorkspaceChanged -= DependencyView.OnWorkspaceChanged;
LoadedParams.CurrentWorkspaceCleared -= DependencyView.OnWorkspaceCleared;
this.Dispose();
}

Expand All @@ -84,6 +84,13 @@ internal void OnMessageLogged(ILogMessage msg)
public void Loaded(ViewLoadedParams viewLoadedParams)
{
DependencyView = new WorkspaceDependencyView(this, viewLoadedParams);
// when a package is loaded update the DependencyView
// as we may have installed a missing package.

pmExtension.PackageLoader.PackgeLoaded += (package) =>
{
DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel);
};

// Adding a button in view menu to refresh and show manually
packageDependencyMenuItem = new MenuItem { Header = Resources.MenuItemString };
Expand All @@ -95,5 +102,6 @@ public void Loaded(ViewLoadedParams viewLoadedParams)
};
viewLoadedParams.AddMenuItem(MenuBarType.View, packageDependencyMenuItem);
}

}
}

0 comments on commit 9243c17

Please sign in to comment.