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

Fixes #2008 Double-click on a module opens "Add building blocks" dial… #2009

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ public virtual void ToggleVisibility()
_region.ToggleVisibility();
}

public virtual bool IsModuleNode(ITreeNode treeNode)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this public?

{
return treeNode.IsAnImplementationOf<ModuleNode>();
}

protected virtual bool IsFolderNode(ITreeNode node)
{
return node.IsAnImplementationOf<RootNode>() || node.IsAnImplementationOf<ClassificationNode>();
Expand Down Expand Up @@ -259,7 +264,7 @@ public virtual bool AllowMultiSelectFor(IEnumerable<ITreeNode> selectedNodes)

public virtual void NodeDoubleClicked(ITreeNode node)
{
if (IsFolderNode(node))
if (IsFolderNode(node) || IsModuleNode(node))
View.ToggleExpandState(node);
}

Expand Down
13 changes: 13 additions & 0 deletions src/OSPSuite.Presentation/Presenters/Nodes/ModuleNode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using OSPSuite.Assets;
using OSPSuite.Core.Domain;

namespace OSPSuite.Presentation.Presenters.Nodes
{
public class ModuleNode : ObjectWithIdAndNameNode<Module>
{
public ModuleNode(Module module) : base(module)
{
Icon = ApplicationIcons.Module;
}
}
}