mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Switching TextViewer from Window to mahWindow
This commit is contained in:
parent
0dc18334ac
commit
10dfe343df
@ -100,27 +100,27 @@ namespace Wabbajack
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var fs = new FileStream(ModListPath, FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||
using (var ar = new ZipArchive(fs, ZipArchiveMode.Read))
|
||||
using (var ms = new MemoryStream())
|
||||
using var fs = new FileStream(ModListPath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
using var ar = new ZipArchive(fs, ZipArchiveMode.Read);
|
||||
using var ms = new MemoryStream();
|
||||
|
||||
var entry = ar.GetEntry(Readme);
|
||||
if (entry == null)
|
||||
{
|
||||
var entry = ar.GetEntry(Readme);
|
||||
if (entry == null)
|
||||
{
|
||||
Utils.Log($"Tried to open a non-existent readme: {Readme}");
|
||||
return;
|
||||
}
|
||||
using (var e = entry.Open())
|
||||
{
|
||||
e.CopyTo(ms);
|
||||
}
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
using (var reader = new StreamReader(ms))
|
||||
{
|
||||
var viewer = new TextViewer(reader.ReadToEnd(), Name);
|
||||
viewer.Show();
|
||||
}
|
||||
Utils.Log($"Tried to open a non-existent readme: {Readme}");
|
||||
return;
|
||||
}
|
||||
|
||||
using (var e = entry.Open())
|
||||
{
|
||||
e.CopyTo(ms);
|
||||
}
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
using var reader = new StreamReader(ms);
|
||||
|
||||
var viewer = new TextViewer(reader.ReadToEnd(), Name);
|
||||
viewer.Show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,15 @@
|
||||
<Window
|
||||
<mah:MetroWindow
|
||||
x:Class="Wabbajack.TextViewer"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Wabbajack"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Wabbajack"
|
||||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
Title="TextViewer"
|
||||
Width="800"
|
||||
Height="450"
|
||||
Icon="../Resources/Icons/wabbajack.ico"
|
||||
WindowTitleBrush="{StaticResource MahApps.Brushes.Accent}"
|
||||
Style="{StaticResource {x:Type Window}}"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
@ -17,4 +18,4 @@
|
||||
FontSize="20"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</Window>
|
||||
</mah:MetroWindow>
|
||||
|
@ -1,8 +1,6 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace Wabbajack
|
||||
namespace Wabbajack
|
||||
{
|
||||
public partial class TextViewer : Window
|
||||
public partial class TextViewer
|
||||
{
|
||||
public TextViewer(string text, string title)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user