-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#16 - allow to frezee item in the Utility Tree componenet
- Loading branch information
Showing
10 changed files
with
138 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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 file contains 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
33 changes: 33 additions & 0 deletions
33
sources/RevitDBExplorer/Domain/Presentation/FreezeCommand.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using RevitDBExplorer.Domain.DataModel; | ||
using RevitDBExplorer.UIComponents.Trees.Base.Items; | ||
using RevitDBExplorer.WPF; | ||
|
||
namespace RevitDBExplorer.Domain.Presentation | ||
{ | ||
internal class FreezeCommand : BaseCommand | ||
{ | ||
public static readonly FreezeCommand Instance = new FreezeCommand(); | ||
|
||
public override bool CanExecute(object parameter) | ||
{ | ||
if (parameter is SnoopableObjectTreeItem treeViewItem) | ||
{ | ||
if (treeViewItem.Object is SnoopableObject snoopableObject) | ||
{ | ||
return !snoopableObject.IsFrozen; | ||
} | ||
} | ||
return false; | ||
} | ||
public override void Execute(object parameter) | ||
{ | ||
if (parameter is SnoopableObjectTreeItem treeViewItem) | ||
{ | ||
if (treeViewItem.Object is SnoopableObject snoopableObject) | ||
{ | ||
snoopableObject.Freeze(); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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