Compare commits

...

5 Commits

3 changed files with 146 additions and 132 deletions

3
.vscode/launch.json vendored
View File

@ -15,7 +15,8 @@
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
"stopAtEntry": false,
"requireExactSource": false
},
{
"name": ".NET Core Attach",

View File

@ -8,8 +8,21 @@ public static class RhSolutionsFunctions
RhSolutionsAddIn.ServiceProvider.GetRequiredService<ICurrencyClient>();
[ExcelFunction(Name = "РЕХАУ")]
public static object ProductSearch(string query)
public static object ProductSearch(object[,] values)
{
List<string> strings = new();
int rows = values.GetLength(0);
int columns = values.GetLength(1);
for (int row = 0; row < rows; row++)
{
for (int column = 0; column < columns; column++)
{
object value = values[row, column];
strings.Add(value.ToString());
}
}
string query = string.Join(" ", strings.ToArray());
var functionName = nameof(ProductSearch);
var parameters = new object[] { query };
if (ExcelAsyncUtil.RunTask(functionName, parameters, async () =>

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472</TargetFrameworks>
<TargetFrameworks>net472;net6.0-windows</TargetFrameworks>
<LangVersion>10</LangVersion>
<OutputType>Library</OutputType>
<RootNamespace>RhSolutions</RootNamespace>
@ -17,8 +17,8 @@
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageReference Include="netDxf" Version="2022.11.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Buffers" Version="4.5.1" />