Skip to content

Commit

Permalink
Upgraded MsgViewer to .net 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Kees van Spelde committed Jun 22, 2024
1 parent b17dff4 commit c36c514
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 149 deletions.
2 changes: 1 addition & 1 deletion MsgReader.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_documentation", "_document
_documentation_\[MS-OXRTFEX].pdf = _documentation_\[MS-OXRTFEX].pdf
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgViewer", "MsgViewer\MsgViewer.csproj", "{0EAB7816-7958-41D7-8713-E410C5403A6C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsgViewer", "MsgViewer\MsgViewer.csproj", "{0EAB7816-7958-41D7-8713-E410C5403A6C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion MsgReaderCore/MsgReader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageIconUrl></PackageIconUrl>
<RepositoryUrl>https://github.com/Sicos1977/MSGReader</RepositoryUrl>
<RepositoryType>GitHub</RepositoryType>
<LangVersion>10.0</LangVersion>
<LangVersion>latest</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>
Expand Down
2 changes: 1 addition & 1 deletion MsgReaderCore/MsgReader.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,2 +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>
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">Latest</s:String></wpf:ResourceDictionary>
2 changes: 0 additions & 2 deletions MsgReaderCore/Reader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@ public string[] ExtractToFolder(
using (var stream = File.Open(inputFile, FileMode.Open, FileAccess.Read, FileShare.Read))
using (var message = new Storage.Message(stream))
{
var id = message.MessageLocalId;

messageType ??= message.Type;

Logger.WriteToLog($"MSG file has the type '{messageType}'");
Expand Down
2 changes: 1 addition & 1 deletion MsgViewer/Helpers/WindowPlacement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static class WindowPlacement
private const int SW_SHOWNORMAL = 1;
private const int SW_SHOWMINIMIZED = 2;
private static readonly Encoding Encoding = new UTF8Encoding();
private static readonly XmlSerializer Serializer = new XmlSerializer(typeof(NativeMethods.WINDOWPLACEMENT));
private static readonly XmlSerializer Serializer = new(typeof(NativeMethods.WINDOWPLACEMENT));
#endregion

#region SetPlacement
Expand Down
113 changes: 7 additions & 106 deletions MsgViewer/MsgViewer.csproj
Original file line number Diff line number Diff line change
@@ -1,126 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<TargetFramework>net6.0-windows</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0EAB7816-7958-41D7-8713-E410C5403A6C}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MsgViewer</RootNamespace>
<AssemblyName>MsgViewer</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<LangVersion>latest</LangVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Wwalczyszyn-Android-Style-Mail.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputPath>bin\Debug\</OutputPath>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputPath>bin\Release\</OutputPath>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="Helpers\HtmlToText.cs" />
<Compile Include="Helpers\NativeMethods.cs" />
<Compile Include="Helpers\Scaling.cs" />
<Compile Include="Settings.cs" />
<Compile Include="ViewerForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ViewerForm.Designer.cs">
<DependentUpon>ViewerForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Helpers\WindowPlacement.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="ViewerForm.resx">
<DependentUpon>ViewerForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="Resources\back-icon.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\forward-icon.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Wwalczyszyn-Android-Style-Mail.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MsgReaderCore\MsgReader.csproj">
<Project>{7627e4f4-44fe-465d-b89d-a4bb669b12d7}</Project>
<Name>MsgReader</Name>
</ProjectReference>
<ProjectReference Include="..\MsgReaderCore\MsgReader.csproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
2 changes: 1 addition & 1 deletion MsgViewer/MsgViewer.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,2 +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">CSharp90</s:String></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">Latest</s:String></wpf:ResourceDictionary>
35 changes: 0 additions & 35 deletions MsgViewer/Properties/AssemblyInfo.cs

This file was deleted.

2 changes: 1 addition & 1 deletion MsgViewer/ViewerForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public partial class ViewerForm : Form
/// <summary>
/// Used to track all the created temporary folders
/// </summary>
readonly List<string> _tempFolders = new List<string>();
readonly List<string> _tempFolders = [];
#endregion

#region Form events
Expand Down

0 comments on commit c36c514

Please sign in to comment.