Compare commits

...

3 Commits

14 changed files with 26 additions and 29 deletions

View File

@ -55,15 +55,9 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
EventsUtil.Initialize();
bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch
if (Environment.GetEnvironmentVariable("ISTESTING") == "false")
{
"true" => true,
"false" => false,
_ => false
};
if (!isTesting)
{
//IntelliSenseServer.Install();
IntelliSenseServer.Install();
}
ServicePointManager.SecurityProtocol =
@ -74,15 +68,9 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
{
EventsUtil.Uninitialize();
bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch
if (Environment.GetEnvironmentVariable("ISTESTING") == "false")
{
"true" => true,
"false" => false,
_ => false
};
if (!isTesting)
{
//IntelliSenseServer.Uninstall();
IntelliSenseServer.Uninstall();
}
}
}

View File

@ -20,21 +20,21 @@ public class RibbonController : ExcelRibbon
public override string GetCustomUI(string RibbonID)
{
return @"
<customUI onLoad='RibbonLoad' xmlns='http://schemas.microsoft.com/office/2006/01/customui'>
<customUI onLoad='RibbonLoad' xmlns='http://schemas.microsoft.com/office/2006/01/customui' loadImage='LoadImage'>
<ribbon>
<tabs>
<tab id='rau' label='RhSolutions'>
<group id='priceList' label='Прайс-лист'>
<button id='export' getEnabled='GetExportEnabled' label='Экспорт в новый файл' size='normal' imageMso='PivotExportToExcel' onAction='OnToolPressed'/>
<button id='export' getEnabled='GetExportEnabled' label='Экспорт в новый файл' size='normal' image='RhSolutions' onAction='OnToolPressed'/>
<button id='convert' getEnabled='GetConvertEnabled' label='Актуализировать' size='normal' imageMso='FileUpdate' onAction='OnToolPressed'/>
<button id='merge' label='Объединить' size='normal' imageMso='Copy' onAction='OnToolPressed'/>
<button id='guess' getEnabled='GetGuessEnabled' label='Найти и экспортировать' size='normal' imageMso='ControlWizards' onAction='OnToolPressed'/>
<button id='fillsleeves' getEnabled='GetFittingsCalcEnabled' label='Подобрать гильзы' size='normal' imageMso='CreateQueryFromWizard' onAction='OnToolPressed'/>
<button id='fillcouplings' getEnabled='GetFittingsCalcEnabled' label='Подобрать муфты' size='normal' imageMso='CreateQueryFromWizard' onAction='OnToolPressed'/>
<button id='dxfexport' getEnabled='GetDxfEnabled' label='Экспортировать в DXF' size='normal' imageMso='ExportExcel' onAction='OnToolPressed'/>
<button id='dxfexport' getEnabled='GetDxfEnabled' label='Экспортировать в DXF' size='normal' image='DXF' onAction='OnToolPressed'/>
</group>
<group id='rausettings' getLabel='GetVersionLabel'>
<button id='setPriceList' getLabel='GetPriceListPathLabel' size='large' imageMso='TableExcelSpreadsheetInsert' onAction='OnSetPricePressed'/>
<button id='setPriceList' getLabel='GetPriceListPathLabel' size='large' image='RhSolutions' onAction='OnSetPricePressed'/>
</group>
</tab>
</tabs>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -22,5 +22,7 @@
<Reference Path="System.Numerics.Vectors.dll" Pack="true" />
<Reference Path="System.Runtime.CompilerServices.Unsafe.dll" Pack="true" />
<Reference Path="System.Threading.Tasks.Extensions.dll" Pack="true" />
<Reference Path="System.ValueTuple.dll" Pack="true" />
<Reference Path="System.ValueTuple.dll" Pack="true" />
<Image Name='RhSolutions' Path='Images\RhSolutions.png' Pack='true' />
<Image Name='DXF' Path='Images\DXF.png' Pack='true' />
</DnaLibrary>

View File

@ -45,4 +45,12 @@
<ItemGroup>
<ProjectReference Include="..\RhSolutions.ProductSku\RhSolutions.ProductSku.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Images\DXF.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Images\RhSolutions.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<RunConfiguration>
<EnvironmentVariables>
<ISTESTING>true</ISTESTING>
</EnvironmentVariables>
</RunConfiguration>
</RunSettings>

View File

@ -13,6 +13,7 @@ public class CanDoGuess : IDisposable
public CanDoGuess()
{
Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_guessReader = new GuessReader(Util.Application);

View File

@ -13,6 +13,7 @@ public class CanFillCouplings : IDisposable
public CanFillCouplings()
{
Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_calculator = new CouplingsCalculator();

View File

@ -13,6 +13,7 @@ public class CanFillSleeves : IDisposable
public CanFillSleeves()
{
Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_calculator = new SleevesCalculator();

View File

@ -12,6 +12,7 @@ public class CanReadProducts : IDisposable
public CanReadProducts()
{
Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_testWorkbook = Util.Application.Workbooks.Add();
_addIn.AutoOpen();

View File

@ -12,6 +12,7 @@ public class CanWriteProducts : IDisposable
public CanWriteProducts()
{
Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_reader = new ExcelReader(Util.Application, RhSolutionsAddIn.Configuration);

View File

@ -12,6 +12,7 @@ public class RealPricelistTest : IDisposable
public RealPricelistTest()
{
Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new();
_addIn.AutoOpen();
_reader = new ExcelReader(Util.Application, RhSolutionsAddIn.Configuration);

View File

@ -10,6 +10,7 @@ public class WorkbookValidationTests : IDisposable
public WorkbookValidationTests()
{
Environment.SetEnvironmentVariable("ISTESTING", "true");
_addIn = new RhSolutionsAddIn();
_addIn.AutoOpen();
Util.Application.Workbooks.Add();