Usings simplify

This commit is contained in:
Sergey Chebotar 2023-03-28 10:36:36 +03:00
parent 2280b49ae1
commit cdb153c988
10 changed files with 390 additions and 437 deletions

View File

@ -1,12 +1,5 @@
using ExcelDna.Integration; namespace RhSolutions.AddIn;
using Microsoft.Extensions.DependencyInjection;
using RhSolutions.Models;
using RhSolutions.Services;
using System.Collections.Generic;
using System.Linq;
namespace RhSolutions.AddIn
{
public class RhSolutionsFunction public class RhSolutionsFunction
{ {
[ExcelFunction(Description = "Распознать артикул и попробовать найти его в прайс-листе")] [ExcelFunction(Description = "Распознать артикул и попробовать найти его в прайс-листе")]
@ -54,4 +47,3 @@ namespace RhSolutions.AddIn
} }
} }
} }
}

View File

@ -1,13 +1,7 @@
using Microsoft.Office.Interop.Excel; using RhSolutions.AddIn;
using RhSolutions.AddIn;
using RhSolutions.Models; namespace RhSolutions.Controllers;
using System;
using System.Collections.Generic;
using System.Linq;
using Range = Microsoft.Office.Interop.Excel.Range;
namespace RhSolutions.Controllers
{
internal class CombineTool : ToolBase internal class CombineTool : ToolBase
{ {
private List<SourcePriceList> SourceFiles { get; set; } private List<SourcePriceList> SourceFiles { get; set; }
@ -63,4 +57,3 @@ namespace RhSolutions.Controllers
} }
} }
} }
}

View File

@ -1,7 +1,5 @@
using RhSolutions.Models; namespace RhSolutions.Controllers;
namespace RhSolutions.Controllers
{
internal class ConvertTool : ToolBase internal class ConvertTool : ToolBase
{ {
private SourcePriceList Current { get; set; } private SourcePriceList Current { get; set; }
@ -27,4 +25,3 @@ namespace RhSolutions.Controllers
} }
} }
} }
}

View File

@ -1,12 +1,9 @@
using Microsoft.Office.Interop.Excel; using RhSolutions.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using RhSolutions.Models;
using System.Linq; using System.Linq;
using Range = Microsoft.Office.Interop.Excel.Range;
namespace RhSolutions.Controllers namespace RhSolutions.Controllers;
{
internal class ExportTool : ToolBase internal class ExportTool : ToolBase
{ {
private Dictionary<Product, double> PositionAmount; private Dictionary<Product, double> PositionAmount;
@ -97,5 +94,4 @@ namespace RhSolutions.Controllers
} }
} }
} }
}

View File

@ -1,15 +1,11 @@
using ExcelDna.Integration.CustomUI; using ExcelDna.Integration.CustomUI;
using Microsoft.Office.Interop.Excel;
using RhSolutions.AddIn; using RhSolutions.AddIn;
using RhSolutions.Services;
using System;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows.Forms; using System.Windows.Forms;
using Range = Microsoft.Office.Interop.Excel.Range;
namespace RhSolutions.Controllers namespace RhSolutions.Controllers;
{
[ComVisible(true)] [ComVisible(true)]
public class RibbonController : ExcelRibbon public class RibbonController : ExcelRibbon
{ {
@ -129,4 +125,3 @@ namespace RhSolutions.Controllers
return string.IsNullOrEmpty(name) ? "Нет файла шаблона!" : name; return string.IsNullOrEmpty(name) ? "Нет файла шаблона!" : name;
} }
} }
}

View File

@ -1,11 +1,4 @@
using Microsoft.Office.Interop.Excel; using RhSolutions.AddIn;
using RhSolutions.AddIn;
using RhSolutions.Models;
using RhSolutions.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using Range = Microsoft.Office.Interop.Excel.Range;
namespace RhSolutions.Controllers namespace RhSolutions.Controllers
{ {

View File

@ -1,13 +1,7 @@
using ExcelDna.Integration; using System.IO;
using Microsoft.Office.Interop.Excel;
using System; namespace RhSolutions.Models;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Range = Microsoft.Office.Interop.Excel.Range;
namespace RhSolutions.Models
{
internal class SourcePriceList : PriceListBase internal class SourcePriceList : PriceListBase
{ {
public Dictionary<Product, double> PositionAmount { get; private set; } public Dictionary<Product, double> PositionAmount { get; private set; }
@ -112,5 +106,4 @@ namespace RhSolutions.Models
} }
} }
} }
}

View File

@ -1,11 +1,7 @@
using Microsoft.Office.Interop.Excel; using System.IO;
using System;
using System.IO; namespace RhSolutions.Models;
using System.Linq;
using Range = Microsoft.Office.Interop.Excel.Range;
namespace RhSolutions.Models
{
internal class TargetPriceList : PriceListBase internal class TargetPriceList : PriceListBase
{ {
public Range OldSkuCell { get; private set; } public Range OldSkuCell { get; private set; }
@ -37,5 +33,4 @@ namespace RhSolutions.Models
} }
} }
} }
}

View File

@ -1,9 +1,5 @@
using Microsoft.Office.Interop.Excel; namespace RhSolutions.Services;
using RhSolutions.Models;
using System.Linq;
namespace RhSolutions.Services
{
public static class WorksheetExtensions public static class WorksheetExtensions
{ {
public static bool IsRehauSource(this Worksheet worksheet) public static bool IsRehauSource(this Worksheet worksheet)
@ -37,5 +33,4 @@ namespace RhSolutions.Services
} }
} }
} }
}

View File

@ -1,5 +1,9 @@
global using ExcelDna.Integration; global using ExcelDna.Integration;
global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Office.Interop.Excel; global using Microsoft.Office.Interop.Excel;
global using RhSolutions.Models;
global using RhSolutions.Services; global using RhSolutions.Services;
global using System; global using System;
global using System.Collections.Generic;
global using System.Linq;
global using Range = Microsoft.Office.Interop.Excel.Range;