Skip to content

Commit b6d1996

Browse files
Update Aspose.OMR Cloud SDK to latest version.
1 parent 7ba6557 commit b6d1996

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

Aspose.OMR.Client/Aspose.OMR.Client/Aspose.OMR.Client.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
5959
</PropertyGroup>
6060
<ItemGroup>
61-
<Reference Include="Aspose.OMR.Cloud.SDK, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
62-
<HintPath>..\packages\Aspose.OMR-Cloud.1.0.3\lib\Aspose.OMR.Cloud.SDK.dll</HintPath>
61+
<Reference Include="Aspose.Omr.Cloud.Sdk, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
62+
<HintPath>..\packages\Aspose.OMR-Cloud.20.2.0\lib\net45\Aspose.Omr.Cloud.Sdk.dll</HintPath>
6363
</Reference>
6464
<Reference Include="Aspose.Storage.Cloud.Sdk, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
6565
<HintPath>..\packages\Aspose.Storage-Cloud.18.3.0\lib\net20\Aspose.Storage.Cloud.Sdk.dll</HintPath>
@@ -68,8 +68,8 @@
6868
<HintPath>..\packages\System.Windows.Interactivity.WPF.2.0.20525\lib\net40\Microsoft.Expression.Interactions.dll</HintPath>
6969
</Reference>
7070
<Reference Include="Microsoft.VisualBasic" />
71-
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
72-
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
71+
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
72+
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
7373
</Reference>
7474
<Reference Include="PresentationFramework.Aero" />
7575
<Reference Include="ReachFramework" />

Aspose.OMR.Client/Aspose.OMR.Client/CoreApi.cs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@
1515
*/
1616
namespace Aspose.OMR.Client
1717
{
18+
using Omr.Cloud.Sdk;
19+
using Omr.Cloud.Sdk.Model;
20+
using Omr.Cloud.Sdk.Model.Requests;
21+
using Storage.Cloud.Sdk;
22+
using Storage.Cloud.Sdk.Api;
23+
using Storage.Cloud.Sdk.Model;
24+
using Storage.Cloud.Sdk.Model.Requests;
1825
using System;
1926
using System.Collections.Generic;
2027
using System.IO;
2128
using System.Linq;
2229
using System.Text;
23-
using Storage.Cloud.Sdk.Api;
24-
using Storage.Cloud.Sdk.Model;
25-
using Storage.Cloud.Sdk;
26-
using Storage.Cloud.Sdk.Model.Requests;
27-
using Com.Aspose.Omr.Model;
28-
using Com.Aspose.Omr.Api;
2930
using TemplateModel;
3031
using Utility;
3132
using ViewModels;
@@ -98,7 +99,7 @@ public static TemplateGenerationContent GenerateTemplate(string descriptionFileN
9899
{
99100
imagesPath = @"{ ""ExtraStoragePath"":""" + imagesPath + @"""}";
100101

101-
OMRResponse response = RunOmrTask(OmrFunctions.GenerateTemplate, descriptionFileName, descriptionData,
102+
OmrResponse response = RunOmrTask(OmrFunctions.GenerateTemplate, descriptionFileName, descriptionData,
102103
imagesPath, false, false, additionalParams);
103104

104105
OmrResponseContent responseResult = response.Payload.Result;
@@ -130,7 +131,7 @@ public static TemplateViewModel CorrectTemplate(string imageName, byte[] imageDa
130131
{
131132
string packedTemplate = PackTemplate(imageName, templateData);
132133

133-
OMRResponse response = RunOmrTask(OmrFunctions.CorrectTemplate, imageName, imageData, packedTemplate,
134+
OmrResponse response = RunOmrTask(OmrFunctions.CorrectTemplate, imageName, imageData, packedTemplate,
134135
wasUploaded, false, additionalParams);
135136

136137
OmrResponseContent responseResult = response.Payload.Result;
@@ -156,7 +157,7 @@ public static TemplateViewModel CorrectTemplate(string imageName, byte[] imageDa
156157
/// <returns>Finalization data containing warnings</returns>
157158
public static FinalizationData FinalizeTemplate(string templateName, byte[] templateData, string templateId, string additionalParams)
158159
{
159-
OMRResponse response = RunOmrTask(OmrFunctions.FinalizeTemplate, templateName, templateData, templateId, false, false, additionalParams);
160+
OmrResponse response = RunOmrTask(OmrFunctions.FinalizeTemplate, templateName, templateData, templateId, false, false, additionalParams);
160161
OmrResponseContent responseResult = response.Payload.Result;
161162
CheckTaskResult(response.Payload.Result);
162163

@@ -177,7 +178,7 @@ public static FinalizationData FinalizeTemplate(string templateName, byte[] temp
177178
/// <returns>Recognition results</returns>
178179
public static ImageRecognitionResult RecognizeImage(string imageName, byte[] imageData, string templateId, bool wasUploaded, string additionalParams)
179180
{
180-
OMRResponse response = RunOmrTask(OmrFunctions.RecognizeImage, imageName, imageData, templateId, wasUploaded, true, additionalParams);
181+
OmrResponse response = RunOmrTask(OmrFunctions.RecognizeImage, imageName, imageData, templateId, wasUploaded, true, additionalParams);
181182

182183
OmrResponseContent responseResult = response.Payload.Result;
183184
if (responseResult.Info.SuccessfulTasksCount < 1 || responseResult.Info.Details.RecognitionStatistics[0].TaskResult != "Pass")
@@ -194,7 +195,7 @@ public static ImageRecognitionResult RecognizeImage(string imageName, byte[] ima
194195

195196
ImageRecognitionResult recognitionResult = new ImageRecognitionResult();
196197

197-
foreach (Com.Aspose.Omr.Model.FileInfo file in responseResult.ResponseFiles)
198+
foreach (Omr.Cloud.Sdk.Model.FileInfo file in responseResult.ResponseFiles)
198199
{
199200
if (file.Name.Contains(".dat"))
200201
{
@@ -221,7 +222,7 @@ public static ImageRecognitionResult RecognizeImage(string imageName, byte[] ima
221222
/// <param name="trackFile">Track file so that it can be deleted from cloud</param>
222223
/// <param name="additionalParam">The additional (debug) parameters</param>
223224
/// <returns>Task response</returns>
224-
public static OMRResponse RunOmrTask(OmrFunctions action, string fileName, byte[] fileData, string functionParam, bool wasUploaded, bool trackFile, string additionalParam)
225+
public static OmrResponse RunOmrTask(OmrFunctions action, string fileName, byte[] fileData, string functionParam, bool wasUploaded, bool trackFile, string additionalParam)
225226
{
226227
if (string.IsNullOrEmpty(AppKey) || string.IsNullOrEmpty(AppSid))
227228
{
@@ -263,9 +264,9 @@ public static OMRResponse RunOmrTask(OmrFunctions action, string fileName, byte[
263264
}
264265
}
265266

266-
OmrApi omrApi = new OmrApi(AppKey, AppSid, Basepath);
267+
OmrApi omrApi = new OmrApi(AppKey, AppSid);
267268

268-
OMRFunctionParam param = new OMRFunctionParam();
269+
OmrFunctionParam param = new OmrFunctionParam();
269270
param.FunctionParam = functionParam;
270271
param.AdditionalParam = additionalParam;
271272

@@ -288,7 +289,10 @@ public static OMRResponse RunOmrTask(OmrFunctions action, string fileName, byte[
288289
}
289290

290291
BusyIndicatorManager.UpdateText(busyMessage);
291-
OMRResponse response = omrApi.PostRunOmrTask(fileName, action.ToString(), param, null, null);
292+
293+
var request = new PostRunOmrTaskRequest(fileName, action.ToString(), param);
294+
OmrResponse response = omrApi.PostRunOmrTask(request);
295+
292296
CheckForError(response);
293297
return response;
294298
}
@@ -403,9 +407,9 @@ private static void CheckTaskResult(OmrResponseContent responseResult)
403407
/// Check response for error
404408
/// </summary>
405409
/// <param name="response">Response to check</param>
406-
private static void CheckForError(OMRResponse response)
410+
private static void CheckForError(OmrResponse response)
407411
{
408-
if (response.ErrorCode != 0 )
412+
if (response.ErrorCode != 0)
409413
{
410414
throw new Exception(response.ErrorText);
411415
}

Aspose.OMR.Client/Aspose.OMR.Client/app.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
1111
<dependentAssembly>
1212
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
13-
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
13+
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
1414
</dependentAssembly>
1515
</assemblyBinding>
1616
</runtime>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Aspose.OMR-Cloud" version="1.0.3" targetFramework="net462" />
3+
<package id="Aspose.OMR-Cloud" version="20.2.0" targetFramework="net462" />
44
<package id="Aspose.Storage-Cloud" version="18.3.0" targetFramework="net462" />
5-
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net462" />
5+
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net462" />
66
<package id="System.Windows.Interactivity.WPF" version="2.0.20525" targetFramework="net462" />
77
</packages>

0 commit comments

Comments
 (0)