Skip to content

Commit

Permalink
Add show all dependencies item to module list.
Browse files Browse the repository at this point in the history
  • Loading branch information
lhak committed Dec 14, 2024
1 parent 51f4986 commit be66453
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
1 change: 1 addition & 0 deletions DependenciesWAS/DependencyModuleList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<MenuFlyoutSeparator/>
<MenuFlyoutItem Text="Open in new tab" Command="{x:Bind ItemContextMenu.Target.DataContext.(local:DisplayModuleInfo.OpenNewAppCommand), Mode=OneWay}" CommandParameter="{x:Bind ItemContextMenu.Target, Mode=OneWay}"/>
<MenuFlyoutItem Text="Open in Peviewer" Command="{x:Bind ItemContextMenu.Target.DataContext.(local:DisplayModuleInfo.OpenPeviewerCommand), Mode=OneWay}" CommandParameter="{x:Bind ItemContextMenu.Target, Mode=OneWay}"/>
<MenuFlyoutItem Text="Show all dependencies..." Command="{Binding ShowAllDependenciesCommand}" CommandParameter="{Binding}"/>
</MenuFlyout>

<Style x:Name="DataGridRowStyleWithContextMenu" BasedOn="{StaticResource DataGridCompactRowStyle}" TargetType="toolkit:DataGridRow">
Expand Down
18 changes: 9 additions & 9 deletions DependenciesWAS/DependencyModuleList.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public RelayCommand DoFindModuleInTreeCommand
set { SetValue(DoFindModuleInTreeCommandProperty, value); }
}

public RelayCommand ConfigureSearchOrderCommand
{
get { return (RelayCommand)GetValue(ConfigureSearchOrderCommandProperty); }
set { SetValue(ConfigureSearchOrderCommandProperty, value); }
public RelayCommand ShowAllDependenciesCommand
{
get { return (RelayCommand)GetValue(ShowAllDependenciesCommandProperty); }
set { SetValue(ShowAllDependenciesCommandProperty, value); }
}

public event RoutedEventHandler SelectedModuleChanged;
Expand All @@ -79,8 +79,8 @@ public RelayCommand ConfigureSearchOrderCommand
public static readonly DependencyProperty DoFindModuleInTreeCommandProperty =
DependencyProperty.Register("DoFindModuleInTreeCommand", typeof(RelayCommand), typeof(DependencyModuleList), new PropertyMetadata(null));

public static readonly DependencyProperty ConfigureSearchOrderCommandProperty =
DependencyProperty.Register("ConfigureSearchOrderCommand", typeof(RelayCommand), typeof(DependencyModuleList), new PropertyMetadata(null));
public static readonly DependencyProperty ShowAllDependenciesCommandProperty =
DependencyProperty.Register("ShowAllDependenciesCommand", typeof(RelayCommand), typeof(DependencyModuleList), new PropertyMetadata(null));

public DependencyModuleList()
{
Expand All @@ -93,7 +93,7 @@ public void AddModule(DisplayModuleInfo NewModule)
{
// TODO : Find a way to properly bind commands instead of using this hack
NewModule.DoFindModuleInTreeCommand = DoFindModuleInTreeCommand;
NewModule.ConfigureSearchOrderCommand = ConfigureSearchOrderCommand;
NewModule.ShowAllDependenciesCommand = ShowAllDependenciesCommand;

Items.Add(NewModule);
}
Expand All @@ -113,11 +113,11 @@ private void ItemContextMenu_Opening(object sender, object e)
}
}

private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
SelectedModuleChanged.Invoke(this, e);
}

public ObservableCollection<DisplayModuleInfo> Items = new ObservableCollection<DisplayModuleInfo>();
}
}
}
18 changes: 10 additions & 8 deletions DependenciesWAS/DependencyWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ public void InitializeView()
// TODO : Find a way to properly bind commands instead of using this hack
this.ModulesList.Items.Clear();
this.ModulesList.DoFindModuleInTreeCommand = DoFindModuleInTree;
this.ModulesList.ConfigureSearchOrderCommand = ConfigureSearchOrderCommand;
this.ModulesList.ShowAllDependenciesCommand = ShowAllDependenciesCommand;

var RootFilename = Path.GetFileName(this.Filename);
var RootModule = new DisplayModuleInfo(RootFilename, this.Pe, ModuleSearchStrategy.ROOT);
Expand Down Expand Up @@ -1432,23 +1432,25 @@ public RelayCommand DoFindModuleInTree
return new RelayCommand((param) =>
{
DisplayModuleInfo SelectedModule = (param as DisplayModuleInfo);
ModuleTreeViewItem TreeRootItem = this.DllTreeView.RootNodes[0] as ModuleTreeViewItem;
ModuleTreeViewItem TreeRootItem = this.DllTreeView.RootNodes[0] as ModuleTreeViewItem;
FindModuleInTree(TreeRootItem, SelectedModule, true);
});
}
}

public RelayCommand ConfigureSearchOrderCommand
public RelayCommand ShowAllDependenciesCommand
{
get
{
return new RelayCommand((param) =>
{
#if TODO
ModuleSearchOrder modalWindow = new ModuleSearchOrder(ProcessedModulesCache);
modalWindow.ShowDialog();
#endif
});
DisplayModuleInfo SelectedModule = (param as DisplayModuleInfo);

if (SelectedModule != null && !string.IsNullOrEmpty(SelectedModule.Filepath))
{
DependenciesListPage.OpenInNewWindow(this.XamlRoot, this.Pe, this.CustomSearchFolders, this.SxsEntriesCache, this.WorkingDirectory, SelectedModule.Filepath);
}
});
}
}
#endregion // Commands
Expand Down
8 changes: 4 additions & 4 deletions DependenciesWAS/Models/ModuleInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,18 +375,18 @@ public string Status

#region Commands
private RelayCommand _DoFindModuleInTreeCommand;
private RelayCommand _ConfigureSearchOrderCommand;
private RelayCommand _ShowAllDependenciesCommand;

public RelayCommand DoFindModuleInTreeCommand
{
get { return _DoFindModuleInTreeCommand; }
set { _DoFindModuleInTreeCommand = value; }
}

public RelayCommand ConfigureSearchOrderCommand
public RelayCommand ShowAllDependenciesCommand
{
get { return _ConfigureSearchOrderCommand; }
set { _ConfigureSearchOrderCommand = value; }
get { return _ShowAllDependenciesCommand; }
set { _ShowAllDependenciesCommand = value; }
}


Expand Down

0 comments on commit be66453

Please sign in to comment.