Skip to content

Commit e3dcbfc

Browse files
author
Sébastien Geiser
committed
Merge branch 'retry_to_net8'
2 parents febe6e3 + a0f0f32 commit e3dcbfc

19 files changed

+185
-201
lines changed
Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<!--<Import Project="PluginInfrastructure\DllExport\NppPlugin.DllExport.targets" />-->
32
<PropertyGroup>
3+
<OutputType>Library</OutputType>
44
<TargetFramework>net481</TargetFramework>
5-
<OutputType>Library</OutputType>
65
<LangVersion>9.0</LangVersion>
76
<AssemblyTitle>C# Regex Tools 4 Npp</AssemblyTitle>
87
<Product>C# Regex Tools 4 Npp</Product>
@@ -18,55 +17,29 @@
1817
<Nullable>disable</Nullable>
1918
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
2019
<Platforms>x64;x86</Platforms>
21-
<Version>1.1.11.0</Version>
22-
<AssemblyVersion>1.1.11.0</AssemblyVersion>
23-
<FileVersion>1.1.11.0</FileVersion>
2420
</PropertyGroup>
25-
<UsingTask TaskName="NppPlugin.DllExport.MSBuild.DllExportTask"
26-
AssemblyFile="PluginInfrastructure\DllExport\NppPlugin.DllExport.MSBuild.dll"/>
21+
<UsingTask TaskName="NppPlugin.DllExport.MSBuild.DllExportTask" AssemblyFile="PluginInfrastructure\DllExport\NppPlugin.DllExport.MSBuild.dll" />
2722
<Target Name="NppTasksPlugin" DependsOnTargets="GetFrameworkPaths" AfterTargets="PostBuildEvent">
2823
<Message Text="NppTasksPlugin" />
2924
<PropertyGroup>
3025
<!-- LibToolPath is optional - it's needed to debug C++, but you can still debug the C# code without it
3126
If you don't have the C++ toolchain installed this is missing, but then you can't' debug C++ anyway -->
3227
<LibToolPath Condition="Exists('$(DevEnvDir)\..\..\VC\bin')">$(DevEnvDir)\..\..\VC\bin</LibToolPath>
3328
</PropertyGroup>
34-
<DllExportTask Platform="$(Platform)"
35-
PlatformTarget="$(PlatformTarget)"
36-
CpuType="$(CpuType)"
37-
EmitDebugSymbols="$(DebugSymbols)"
38-
DllExportAttributeAssemblyName="$(DllExportAttributeAssemblyName)"
39-
DllExportAttributeFullName="$(DllExportAttributeFullName)"
40-
Timeout="$(DllExportTimeout)"
41-
KeyContainer="$(KeyContainerName)$(AssemblyKeyContainerName)"
42-
KeyFile="$(KeyOriginatorFile)"
43-
ProjectDirectory="$(MSBuildProjectDirectory)"
44-
InputFileName="$(TargetPath)"
45-
FrameworkPath="$(TargetedFrameworkDir);$(TargetFrameworkDirectory)"
46-
LibToolPath="$(LibToolPath)"
47-
LibToolDllPath="$(DevEnvDir)"
48-
SdkPath="$(SDK40ToolsPath)"/>
29+
<DllExportTask Platform="$(Platform)" PlatformTarget="$(PlatformTarget)" CpuType="$(CpuType)" EmitDebugSymbols="$(DebugSymbols)" DllExportAttributeAssemblyName="$(DllExportAttributeAssemblyName)" DllExportAttributeFullName="$(DllExportAttributeFullName)" Timeout="$(DllExportTimeout)" KeyContainer="$(KeyContainerName)$(AssemblyKeyContainerName)" KeyFile="$(KeyOriginatorFile)" ProjectDirectory="$(MSBuildProjectDirectory)" InputFileName="$(TargetPath)" FrameworkPath="$(TargetedFrameworkDir);$(TargetFrameworkDirectory)" LibToolPath="$(LibToolPath)" LibToolDllPath="$(DevEnvDir)" SdkPath="$(SDK40ToolsPath)" />
4930

5031
<ItemGroup>
51-
<ReleaseFiles Include="$(TargetDir)*.dll"/>
52-
<ReleaseFiles Include="$(TargetDir)*.pdb"/>
32+
<ReleaseFiles Include="$(TargetDir)CSharpRegexTools4Npp.dll" />
33+
<!--<ReleaseFiles Include="$(TargetDir)*.pdb" />-->
5334
</ItemGroup>
5435
<!-- $(MSBuildProgramFiles32) points to the 32 bit program files dir.
5536
On 32 bit windows usually C:\Program Files\
5637
On 64 bit windows usually C:\Program Files (x86)\
5738
$(ProgramW6432) points to the 64bit Program Files (on 32 bit windows it is blank) -->
5839
<MakeDir Directories="$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\" Condition="Exists('$(MSBuildProgramFiles32)\Notepad++\plugins\') AND !Exists('$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x86'" />
59-
<Copy
60-
SourceFiles="@(ReleaseFiles)"
61-
DestinationFolder="$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\"
62-
Condition="Exists('$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x86'"
63-
ContinueOnError="false" />
40+
<Copy SourceFiles="@(ReleaseFiles)" DestinationFolder="$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\" Condition="Exists('$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x86'" ContinueOnError="false" />
6441
<MakeDir Directories="$(ProgramW6432)\Notepad++\plugins\$(TargetName)\" Condition="Exists('$(ProgramW6432)\Notepad++\plugins\') AND !Exists('$(ProgramW6432)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x64'" />
65-
<Copy
66-
SourceFiles="@(ReleaseFiles)"
67-
DestinationFolder="$(ProgramW6432)\Notepad++\plugins\$(TargetName)\"
68-
Condition="Exists('$(ProgramW6432)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x64'"
69-
ContinueOnError="false" />
42+
<Copy SourceFiles="@(ReleaseFiles)" DestinationFolder="$(ProgramW6432)\Notepad++\plugins\$(TargetName)\" Condition="Exists('$(ProgramW6432)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x64'" ContinueOnError="false" />
7043
</Target>
7144
<ItemGroup>
7245
<None Remove="NppPlugin.DllExport.targets" />
@@ -98,8 +71,14 @@
9871
<ProjectReference Include="..\RegexDialog\RegexDialog.csproj" />
9972
</ItemGroup>
10073
<ItemGroup>
101-
<PackageReference Include="Costura.Fody" Version="5.7.0" PrivateAssets="all" />
102-
<PackageReference Include="Fody" Version="6.8.0" PrivateAssets="all" />
74+
<PackageReference Include="Costura.Fody" Version="5.7.0" PrivateAssets="all">
75+
<PrivateAssets>all</PrivateAssets>
76+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
77+
</PackageReference>
78+
<PackageReference Include="Fody" Version="6.8.0" PrivateAssets="all">
79+
<PrivateAssets>all</PrivateAssets>
80+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
81+
</PackageReference>
10382
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
10483
</ItemGroup>
10584
</Project>

CSharpRegexTools4Npp/Main.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ internal static void SetToolBarIcon()
8181
&& int.TryParse(Npp.NotepadPP.NppBinVersion.Split('.')[0], out int majorVersion)
8282
&& majorVersion >= 8)
8383
{
84-
toolbarIconsWithDarkMode tbIcons = new toolbarIconsWithDarkMode
84+
toolbarIconsWithDarkMode tbIcons = new()
8585
{
8686
hToolbarBmp = tbBmp.GetHbitmap(),
8787
hToolbarIcon = tbBmp.GetHicon(),
@@ -95,7 +95,7 @@ internal static void SetToolBarIcon()
9595
}
9696
else
9797
{
98-
toolbarIcons tbIcons = new toolbarIcons
98+
toolbarIcons tbIcons = new()
9999
{
100100
hToolbarBmp = tbBmp.GetHbitmap(),
101101
hToolbarIcon = tbBmp.GetHicon(),
@@ -120,7 +120,7 @@ private static async void CheckUpdates(RegExToolDialog dialog)
120120

121121
try
122122
{
123-
HttpClient client = new HttpClient();
123+
HttpClient client = new();
124124
client.DefaultRequestHeaders.Add("Accept-Language", "en-US;q=0.5,en;q=0.3");
125125
client.DefaultRequestHeaders.Add("User-Agent", "C# App");
126126

@@ -131,7 +131,7 @@ private static async void CheckUpdates(RegExToolDialog dialog)
131131
var jsonResult = JObject.Parse(responseText);
132132

133133
int[] latestVersion = jsonResult["name"].ToString().Split('.').Select(digit => int.Parse(digit.Trim())).ToArray();
134-
int[] currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.').Select(digit => int.Parse(digit.Trim())).ToArray();
134+
int[] currentVersion = typeof(RegExToolDialog).Assembly.GetName().Version.ToString().Split('.').Select(digit => int.Parse(digit.Trim())).ToArray();
135135

136136
Debug.WriteLine($"{latestVersion} - {currentVersion}");
137137

CSharpRegexTools4Npp/Npp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static class Npp
88
{
99
public static NotepadPPGateway NotepadPP { get; } = new NotepadPPGateway();
1010

11-
public static ScintillaGateway Scintilla => new ScintillaGateway(PluginBase.GetCurrentScintilla());
11+
public static ScintillaGateway Scintilla => new(PluginBase.GetCurrentScintilla());
1212

1313
/// <summary>
1414
/// Récupère les caractères de fin de lignes courant

CSharpRegexTools4Npp/PluginInfrastructure/ClikeStringArray.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public ClikeStringArray(List<string> lstStrings)
4141
public List<string> ManagedStringsUnicode { get { return _getManagedItems(true); } }
4242
List<string> _getManagedItems(bool unicode)
4343
{
44-
List<string> _managedItems = new List<string>();
44+
List<string> _managedItems = new();
4545
for (int i = 0; i < _nativeItems.Count; i++)
4646
{
4747
if (unicode) _managedItems.Add(Marshal.PtrToStringUni(_nativeItems[i]));

CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace CSharpRegexTools4Npp.PluginInfrastructure
66
public class PluginBase
77
{
88
public static NppData nppData;
9-
public static FuncItems _funcItems = new FuncItems();
9+
public static FuncItems _funcItems = new();
1010

1111
public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer)
1212
{
@@ -25,7 +25,7 @@ public static void SetCommand(int index, string commandName, NppFuncItemDelegate
2525

2626
public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit)
2727
{
28-
FuncItem funcItem = new FuncItem
28+
FuncItem funcItem = new()
2929
{
3030
_cmdID = index,
3131
_itemName = commandName

CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void RefreshItems()
125125
IntPtr ptrPosItem = _nativePointer;
126126
for (int i = 0; i < _funcItems.Count; i++)
127127
{
128-
FuncItem updatedItem = new FuncItem();
128+
FuncItem updatedItem = new();
129129
updatedItem._itemName = _funcItems[i]._itemName;
130130
ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 128);
131131
updatedItem._pFunc = _funcItems[i]._pFunc;

CSharpRegexTools4Npp/PluginInfrastructure/ScintillaGateway.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public int GetCurrentLineNumber()
7676
/// <returns>A ScrollInfo struct with information of the current scroll state</returns>
7777
public ScrollInfo GetScrollInfo(ScrollInfoMask mask = ScrollInfoMask.SIF_ALL, ScrollInfoBar scrollBar = ScrollInfoBar.SB_BOTH)
7878
{
79-
ScrollInfo scrollInfo = new ScrollInfo();
79+
ScrollInfo scrollInfo = new();
8080
scrollInfo.cbSize = (uint)Marshal.SizeOf(scrollInfo);
8181
scrollInfo.fMask = (uint)mask;
8282
Win32.GetScrollInfo(scintilla, (int)scrollBar, ref scrollInfo);

RegexDialog/Model/ExcelSheetSelection.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ namespace RegexDialog
1212
{
1313
public class ExcelSheetSelection : NotifyPropertyChangedBaseClass
1414
{
15-
private readonly static Regex simpleCellRegex = new Regex("^[A-Z]+[1-9][0-9]*$", RegexOptions.Compiled);
16-
private readonly static Regex simpleColumnRegex = new Regex("^[A-Z]+$", RegexOptions.Compiled);
17-
private readonly static Regex simpleRowRegex = new Regex("^[1-9][0-9]*$", RegexOptions.Compiled);
18-
private readonly static Regex rangeRegex = new Regex("^[A-Z]+([1-9][0-9]*)?:[A-Z]+([1-9][0-9]*)?|[1-9][0-9]*:[1-9][0-9]*$", RegexOptions.Compiled);
19-
private readonly static Regex evaluatedExpressionRegex = new Regex(@"\{(?<expression>[^\}]*)\}", RegexOptions.Compiled);
15+
private readonly static Regex simpleCellRegex = new("^[A-Z]+[1-9][0-9]*$", RegexOptions.Compiled);
16+
private readonly static Regex simpleColumnRegex = new("^[A-Z]+$", RegexOptions.Compiled);
17+
private readonly static Regex simpleRowRegex = new("^[1-9][0-9]*$", RegexOptions.Compiled);
18+
private readonly static Regex rangeRegex = new("^[A-Z]+([1-9][0-9]*)?:[A-Z]+([1-9][0-9]*)?|[1-9][0-9]*:[1-9][0-9]*$", RegexOptions.Compiled);
19+
private readonly static Regex evaluatedExpressionRegex = new(@"\{(?<expression>[^\}]*)\}", RegexOptions.Compiled);
2020

2121
public bool IsSelected { get; set; } = true;
2222
public string Name { get; set; } = string.Empty;
@@ -78,7 +78,7 @@ public IEnumerable<IXLCell> GetCells(IXLWorksheet sheet)
7878

7979
private string InterpretStuffInFilter(string filter, IXLWorksheet sheet)
8080
{
81-
ExpressionEvaluator evaluator = new ExpressionEvaluator(new Dictionary<string, object>()
81+
ExpressionEvaluator evaluator = new(new Dictionary<string, object>()
8282
{
8383
{ "FR", sheet.FirstRowUsed().RangeAddress.FirstAddress.RowNumber },
8484
{ "LR", sheet.LastRowUsed().RangeAddress.FirstAddress.RowNumber },

0 commit comments

Comments
 (0)