-
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
DYN-4117: Delete Button missing from Package Manager preferences panel #12249
Conversation
Thank you for restoring it, I love this function! |
&& Model.LoadState.ScheduledState != PackageLoadState.ScheduledTypes.ScheduledForDeletion | ||
&& !CanUninstall()) | ||
{ | ||
return Resources.PackageContextMenuDeletePackageCustomNodesInUseTooltip; |
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.
@sm6srw By custom nodes ...do you mean non-built-in ? or custom node definitions ?
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.
Custom Node definitions
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.
Hmm..I do not see any specific checks for custom node defs...is that the only possibility?...what about packages with loaded assemblies...
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.
The check is in CanUnInstall(). It is a little strange because we say that a package can always be uninstalled if the package has a loaded assembly. But it can not be uninstalled if it has custom nodes that are in use. We missed that case. What I think is missing is to do the same thing for all packages (allow or not allow). But that is future work. For now we just try to clarify this a bit.
public bool LoadedWithNoScheduledOperation | ||
{ | ||
get | ||
{ | ||
return Model.BuiltInPackage ? | ||
Model.LoadState.State != PackageLoadState.StateTypes.Unloaded && | ||
Model.LoadState.ScheduledState != PackageLoadState.ScheduledTypes.ScheduledForUnload : | ||
Model.LoadState.ScheduledState != PackageLoadState.ScheduledTypes.ScheduledForDeletion; | ||
} | ||
} |
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.
How is this condition different from simply checking Model.LoadState.State == PackageLoadState.StateTypes.Loaded
?
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.
I am not 100% sure why we can't check for Loaded only but I think it has to do with packages in an error state. I just followed the existing pattern and made a property of it so I can use it here and for viability control in the xaml file.
if (Model.LoadState.State != PackageLoadState.StateTypes.Unloaded | ||
&& Model.LoadState.ScheduledState != PackageLoadState.ScheduledTypes.ScheduledForDeletion |
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.
How about just checking for if(!CanUininstall())
?
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.
Thanks, that should work I think. The control will be hidden in those cases when this matter. I will give it a try.
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.
Works fine.
Purpose
This pull request does:
Declaration
Check these if you believe they are true
*.resx
filesRelease Notes
(FILL ME IN) Brief description of the fix / enhacement. Mandatory section