-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP event listener from webservice to pwsh #8
- Loading branch information
Showing
11 changed files
with
118 additions
and
26 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
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
22 changes: 22 additions & 0 deletions
22
...dio.LazyAdmin.DesktopApp/HoubyStudio.LazyAdmin.DesktopApp/Pwsh/Providers/IPwshProvider.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,22 @@ | ||
// <copyright file="IPwshProvider.cs" company="Houby Studio"> | ||
// Copyright (c) Houby Studio. All rights reserved. | ||
// </copyright> | ||
|
||
namespace HoubyStudio.LazyAdmin.DesktopApp.Pwsh.Providers | ||
{ | ||
using Microsoft.Web.WebView2.Core; | ||
using System.Threading.Tasks; | ||
|
||
/// <summary> | ||
/// PowerShell process provider interface. | ||
/// </summary> | ||
public interface IPwshProvider | ||
{ | ||
/// <summary> | ||
/// Handles message received from <see cref="WebView.Providers.WebViewCommunicationProvider"/>. | ||
/// </summary> | ||
/// <param name="sender">Sender object.</param> | ||
/// <param name="args">Arguments received from the event.</param> | ||
public void ReceiveMessageFromWebView(object sender, CoreWebView2WebMessageReceivedEventArgs args); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...udio.LazyAdmin.DesktopApp/HoubyStudio.LazyAdmin.DesktopApp/Pwsh/Providers/PwshProvider.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 @@ | ||
// <copyright file="PwshProvider.cs" company="Houby Studio"> | ||
// Copyright (c) Houby Studio. All rights reserved. | ||
// </copyright> | ||
|
||
namespace HoubyStudio.LazyAdmin.DesktopApp.Pwsh.Providers | ||
{ | ||
using Microsoft.Extensions.Logging; | ||
using Microsoft.Web.WebView2.Core; | ||
|
||
/// <summary> | ||
/// PowerShell process provider. | ||
/// </summary> | ||
public class PwshProvider : IPwshProvider | ||
{ | ||
private ILogger<PwshProvider> logger; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="PwshProvider"/> class. | ||
/// </summary> | ||
/// <param name="logger">Dependent logger interface.</param> | ||
public PwshProvider(ILogger<PwshProvider> logger) | ||
{ | ||
this.logger = logger; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public virtual void ReceiveMessageFromWebView(object sender, CoreWebView2WebMessageReceivedEventArgs args) | ||
{ | ||
this.logger.LogInformation("Received message from Webview!"); | ||
return; | ||
} | ||
} | ||
} |
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