Skip to content

Commit

Permalink
Fix issue #318
Browse files Browse the repository at this point in the history
  • Loading branch information
Kees van Spelde committed Dec 21, 2022
1 parent 24cfe62 commit d457023
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 106 deletions.
7 changes: 4 additions & 3 deletions MsgReaderCore/Helpers/FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using System.Globalization;
using System.IO;
using System.Linq;
// ReSharper disable UseIndexFromEndExpression

namespace MsgReader.Helpers
{
Expand Down Expand Up @@ -121,7 +122,7 @@ public static string GetExtension(string path)
throw new ArgumentException("path");

var splittedPath = path.Split(Path.DirectorySeparatorChar);
var fileName = splittedPath[^1];
var fileName = splittedPath[splittedPath.Length - 1];

var index = fileName.LastIndexOf(".", StringComparison.Ordinal);

Expand All @@ -144,8 +145,8 @@ public static string GetFileNameWithoutExtension(string path)
throw new ArgumentException(@"No path given", nameof(path));

var splittedPath = path.Split(Path.DirectorySeparatorChar);
var fileName = splittedPath[^1];
return !fileName.Contains(".")
var fileName = splittedPath[splittedPath.Length - 1];
return !fileName.Contains('.')
? fileName
: fileName.Substring(0, fileName.LastIndexOf(".", StringComparison.Ordinal));
}
Expand Down
164 changes: 85 additions & 79 deletions MsgReaderCore/MsgReader.csproj
Original file line number Diff line number Diff line change
@@ -1,93 +1,99 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6;net5;net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<RootNamespace>MsgReader</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.4.13</Version>
<AssemblyVersion>4.4.13.0</AssemblyVersion>
<Authors>Kees van Spelde</Authors>
<Company>Magic-Sessions</Company>
<Copyright>(c)2013-2022 - Kees van Spelde</Copyright>
<PackageProjectUrl>https://github.com/Sicos1977/MSGReader</PackageProjectUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageIconUrl></PackageIconUrl>
<RepositoryUrl>https://github.com/Sicos1977/MSGReader</RepositoryUrl>
<RepositoryType>GitHub</RepositoryType>
<PackageTags>Outlook MSG Signed EML Contact Appointment Task</PackageTags>
<Description>Read Outlook MSG and EML files without using Outlook.
<PropertyGroup>
<TargetFrameworks>net6;net5;net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<RootNamespace>MsgReader</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.4.13</Version>
<AssemblyVersion>4.4.13.0</AssemblyVersion>
<Authors>Kees van Spelde</Authors>
<Company>Magic-Sessions</Company>
<Copyright>(c)2013-2023 - Kees van Spelde</Copyright>
<PackageProjectUrl>https://github.com/Sicos1977/MSGReader</PackageProjectUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageIconUrl></PackageIconUrl>
<RepositoryUrl>https://github.com/Sicos1977/MSGReader</RepositoryUrl>
<RepositoryType>GitHub</RepositoryType>
<LangVersion>10.0</LangVersion>
<PackageTags>Outlook MSG Signed EML Contact Appointment Task</PackageTags>
<Description>
Read Outlook MSG and EML files without using Outlook.

The MSGReader supports MSG E-Mail (also signed), Contact, Appointment, Task, Sticky notes and Contact files.

The EML reader supports MIME 1.0 encoded files</Description>
<PackageReleaseNotes>- Updates nuget packages
- Fix various decoding issues with 2 byte charsets</PackageReleaseNotes>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MSGReader.snk</AssemblyOriginatorKeyFile>
<FileVersion>4.4.13.0</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>Outlook-icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
The MSGReader supports MSG E-Mail (also signed), Contact, Appointment, Task, Sticky notes and Contact files.

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>MsgReader.xml</DocumentationFile>
</PropertyGroup>
The EML reader supports MIME 1.0 encoded files
</Description>
<PackageReleaseNotes>
- Updates nuget packages
- Fix various decoding issues with 2 byte charsets
</PackageReleaseNotes>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MSGReader.snk</AssemblyOriginatorKeyFile>
<FileVersion>4.4.13.0</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>Outlook-icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.5.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.5.1" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>MsgReader.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<Reference Include="System" />
<Reference Include="System.Security" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.5.1" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Properties\**" />
<EmbeddedResource Remove="Properties\**" />
<None Remove="Properties\**" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.5.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.2.1" />
<PackageReference Include="OpenMcdf" Version="2.2.1.12" />
<PackageReference Include="RtfPipe" Version="2.0.7677.4303" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<Reference Include="System" />
<Reference Include="System.Security" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5' or '$(TargetFramework)' == 'net6' ">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Properties\**" />
<EmbeddedResource Remove="Properties\**" />
<None Remove="Properties\**" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="Outlook-icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.2.1" />
<PackageReference Include="OpenMcdf" Version="2.2.1.12" />
<PackageReference Include="RtfPipe" Version="2.0.7677.4303" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
</ItemGroup>

<ItemGroup>
<Compile Update="Localization\LanguageConsts.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>LanguageConsts.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5' or '$(TargetFramework)' == 'net6' ">
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Localization\LanguageConsts.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>LanguageConsts.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="Outlook-icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

</Project>
<ItemGroup>
<Compile Update="Localization\LanguageConsts.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>LanguageConsts.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Localization\LanguageConsts.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>LanguageConsts.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions MsgReaderCore/MsgReader.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp100</s:String></wpf:ResourceDictionary>
Loading

0 comments on commit d457023

Please sign in to comment.