-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
80 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using TableCloth.Components; | ||
using TableCloth.Contracts; | ||
|
||
namespace TableCloth.Commands | ||
{ | ||
public sealed class CertSelectCommand : CommandBase | ||
{ | ||
public CertSelectCommand( | ||
AppUserInterface appUserInterface) | ||
{ | ||
_appUserInterface = appUserInterface; | ||
} | ||
|
||
private readonly AppUserInterface _appUserInterface; | ||
|
||
public AppUserInterface AppUserInterface | ||
=> _appUserInterface; | ||
|
||
public override void Execute(object? parameter) | ||
{ | ||
var viewModel = parameter as ICertSelect; | ||
|
||
if (viewModel == null) | ||
throw new ArgumentException(nameof(parameter)); | ||
|
||
var certSelectWindow = _appUserInterface.CreateWindow<CertSelectWindow>(); | ||
var response = certSelectWindow.ShowDialog(); | ||
|
||
if (!response.HasValue || !response.Value) | ||
return; | ||
|
||
if (certSelectWindow.ViewModel.SelectedCertPair != null) | ||
viewModel.SelectedCertFile = certSelectWindow.ViewModel.SelectedCertPair; | ||
} | ||
} | ||
} |
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,9 @@ | ||
using TableCloth.Models.Configuration; | ||
|
||
namespace TableCloth.Contracts | ||
{ | ||
public interface ICertSelect | ||
{ | ||
X509CertPair? SelectedCertFile { get; set; } | ||
} | ||
} |
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