fix(Plugins): исправлена компиляция в версии 3.34

This commit is contained in:
Антон Чичков 2020-02-28 11:11:34 +10:00
parent 501b10d793
commit ba90e5f46e
3 changed files with 8 additions and 16 deletions

View File

@ -19,7 +19,7 @@ namespace Vkt5_RemoteConsole.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {

View File

@ -154,35 +154,27 @@ namespace Vkt5_RemoteConsole
/// <param name="request"></param>
/// <param name="responseLength"></param>
/// <param name="readHandler"></param>
private void SendRequest(byte[] request, int responseLength, VktDataReadEventHandler readHandler)
private async void SendRequest(byte[] request, int responseLength, VktDataReadEventHandler readHandler)
{
CommandSettings cmd = new CommandSettings("", 1000, responseLength, 10);
var cmd = new CommandSettings("", 1000, responseLength, 10);
this.handlers.AddLast(readHandler);
this.responseLength = responseLength;
this.remoteConsole.SendCommandAsync(request, cmd, 0, DataReadCallback, null);
}
private void DataReadCallback(Lers.AsyncOperation asyncOp)
{
try
{
// Завершаем операцию чтения данных
Lers.Networking.ExecuteRequestAsyncOperation execRequestAsyncOp
= (Lers.Networking.ExecuteRequestAsyncOperation)asyncOp;
execRequestAsyncOp.EndExecuteRequest();
await remoteConsole.SendCommandAsync(request, cmd, 0);
}
catch (Exception e)
{
// При ошибке отправки данных отключаемся от устройства
LogError("Ошибка чтения данных. " + e.Message);
}
}
private void remoteConsole_DeviceDataReceived(object sender, DeviceDataEventArgs args)
private async void remoteConsole_DeviceDataReceived(object sender, DeviceDataEventArgs args)
{
// Проверим, что консоль подключена к прибору
if (!this.remoteConsole.IsConnected)
@ -205,7 +197,7 @@ namespace Vkt5_RemoteConsole
// Отключаемся
try
{
this.remoteConsole.DisconnectAsync(null, null);
await remoteConsole.DisconnectAsync();
}
catch (Lers.PermissionDeniedException exc)
{

View File

@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Vkt5_RemoteConsole</RootNamespace>
<AssemblyName>Vkt5_RemoteConsole</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>