Remove IntelliSense server

This commit is contained in:
Serghei Cebotari 2024-01-18 23:23:26 +03:00
parent 7b2a5955d8
commit 84001e050c
3 changed files with 12 additions and 31 deletions

View File

@ -1,14 +1,7 @@
using System.Net; using System.Net;
using ExcelDna.IntelliSense;
#if !NET472
using System.Runtime.Versioning;
#endif
namespace RhSolutions.AddIn; namespace RhSolutions.AddIn;
#if !NET472
[SupportedOSPlatform("windows")]
#endif
public sealed class RhSolutionsAddIn : IExcelAddIn public sealed class RhSolutionsAddIn : IExcelAddIn
{ {
public static Application Excel { get; private set; } public static Application Excel { get; private set; }
@ -55,11 +48,6 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
EventsUtil.Initialize(); EventsUtil.Initialize();
if (Environment.GetEnvironmentVariable("ISTESTING") == "false")
{
IntelliSenseServer.Install();
}
ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol =
SecurityProtocolType.Tls12; SecurityProtocolType.Tls12;
} }
@ -67,10 +55,5 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
public void AutoClose() public void AutoClose()
{ {
EventsUtil.Uninitialize(); EventsUtil.Uninitialize();
if (Environment.GetEnvironmentVariable("ISTESTING") == "false")
{
IntelliSenseServer.Uninstall();
}
} }
} }

View File

@ -5,8 +5,8 @@ public static class RhSolutionsFunctions
private static IDatabaseClient databaseClient = RhSolutionsAddIn.ServiceProvider.GetService<IDatabaseClient>(); private static IDatabaseClient databaseClient = RhSolutionsAddIn.ServiceProvider.GetService<IDatabaseClient>();
private static ICurrencyClient currencyClient = RhSolutionsAddIn.ServiceProvider.GetRequiredService<ICurrencyClient>(); private static ICurrencyClient currencyClient = RhSolutionsAddIn.ServiceProvider.GetRequiredService<ICurrencyClient>();
[ExcelFunction(Description = "Поиск артикула в базе данных")] [ExcelFunction]
public static object РЕХАУ([ExcelArgument(Name = "СТРОКА", Description = "Ячейка с артикулом РЕХАУ или поисковый запрос в свободной форме")] string query) public static object РЕХАУ(string query)
{ {
ProductSku.TryParse(query, out var skus); ProductSku.TryParse(query, out var skus);
@ -45,8 +45,8 @@ public static class RhSolutionsFunctions
} }
} }
[ExcelFunction(Description = "Выделить артикул РЕХАУ из ячейки")] [ExcelFunction]
public static object РЕХАУАРТИКУЛ([ExcelArgument(Name = "СТРОКА", Description = "Ячейка содержащая артикул РЕХАУ")] string query) public static object РЕХАУАРТИКУЛ(string query)
{ {
if (ProductSku.TryParse(query, out var skus)) if (ProductSku.TryParse(query, out var skus))
{ {
@ -58,8 +58,8 @@ public static class RhSolutionsFunctions
} }
} }
[ExcelFunction(Description = "Поиск названия по артикулу РЕХАУ")] [ExcelFunction]
public static object РЕХАУИМЯ([ExcelArgument(Name = "АРТИКУЛ", Description = "Ячейка содержащая артикул РЕХАУ")] string query) public static object РЕХАУИМЯ(string query)
{ {
if (!ProductSku.TryParse(query, out var skus)) if (!ProductSku.TryParse(query, out var skus))
{ {
@ -93,8 +93,8 @@ public static class RhSolutionsFunctions
} }
} }
[ExcelFunction(Description = "Поиск цены артикула РЕХАУ в евро")] [ExcelFunction]
public static object РЕХАУЦЕНА([ExcelArgument(Name = "АРТИКУЛ", Description = "Ячейка содержащая артикул РЕХАУ")] string query) public static object РЕХАУЦЕНА(string query)
{ {
if (!ProductSku.TryParse(query, out var skus)) if (!ProductSku.TryParse(query, out var skus))
{ {
@ -128,9 +128,8 @@ public static class RhSolutionsFunctions
} }
} }
[ExcelFunction(Description = "Поиск цены артикула РЕХАУ в рублях")] [ExcelFunction]
public static object РЕХАУЦЕНАРУБ([ExcelArgument(Name = "АРТИКУЛ", Description = "Ячейка содержащая артикул РЕХАУ")] string line, public static object РЕХАУЦЕНАРУБ(string line, double dateField)
[ExcelArgument(Name = "ДАТА", Description = "Дата в формате Excel (необязательно)")] double dateField)
{ {
if (!ProductSku.TryParse(line, out var skus)) if (!ProductSku.TryParse(line, out var skus))
{ {
@ -180,8 +179,8 @@ public static class RhSolutionsFunctions
} }
} }
[ExcelFunction(Description = "Получить курс евро по ЦБ")] [ExcelFunction]
public static object КУРСЕВРО([ExcelArgument(Name = "ДАТА", Description = "Дата в формате Excel (необязательно)")] double dateField) public static object КУРСЕВРО(double dateField)
{ {
DateTime date = dateField == 0 ? DateTime.Today : DateTime.FromOADate(dateField); DateTime date = dateField == 0 ? DateTime.Today : DateTime.FromOADate(dateField);

View File

@ -30,7 +30,6 @@
<TreatAsUsed>true</TreatAsUsed> <TreatAsUsed>true</TreatAsUsed>
</PackageReference> </PackageReference>
<PackageReference Include="ExcelDna.Integration" Version="1.7.0" /> <PackageReference Include="ExcelDna.Integration" Version="1.7.0" />
<PackageReference Include="ExcelDna.IntelliSense" Version="1.7.0" />
<PackageReference Include="ExcelDna.Interop" Version="15.0.1" /> <PackageReference Include="ExcelDna.Interop" Version="15.0.1" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" /> <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" /> <PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />