From 92b32975e895966a5b936aaa0d64fc203da4de70 Mon Sep 17 00:00:00 2001 From: Holger Boerchers Date: Sat, 16 Jun 2018 09:59:36 +0200 Subject: [PATCH] fixed warnings. --- Creator/Helper/Log.cs | 1 - Creator/Program.cs | 2 +- Example/App.xaml | 1 - Example/App.xaml.cs | 6 ++---- Example/MainWindow.xaml | 1 - Katteker.Test/Properties/AssemblyInfo.cs | 1 - Katteker/ChangelogHelper.cs | 8 ++++++-- Katteker/ReleaseEntry.cs | 5 +++-- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Creator/Helper/Log.cs b/Creator/Helper/Log.cs index 1c253ac..d36e7c8 100644 --- a/Creator/Helper/Log.cs +++ b/Creator/Helper/Log.cs @@ -1,5 +1,4 @@ using System; -using System.Threading; namespace KattekerCreator.Helper { diff --git a/Creator/Program.cs b/Creator/Program.cs index 3b54e4b..af76eda 100644 --- a/Creator/Program.cs +++ b/Creator/Program.cs @@ -63,7 +63,7 @@ namespace KattekerCreator var additionalFiles = new[] { new PhysicalFile(appStubFile, Path.GetFileName(_appArguments.ProgramFile)), - new PhysicalFile(configFile, Path.Combine($"app-{_assemblyFileInfo.AssemblyVersion}", Path.GetFileName(configFile))) + new PhysicalFile(configFile, Path.Combine($"app-{_assemblyFileInfo.AssemblyVersion}", Path.GetFileName(configFile) ?? string.Empty)) }; var templateFile = GenerateNsisTemplate(additionalFiles); //Start makensis.exe diff --git a/Example/App.xaml b/Example/App.xaml index bdff48f..acf7cf6 100644 --- a/Example/App.xaml +++ b/Example/App.xaml @@ -1,7 +1,6 @@  diff --git a/Example/App.xaml.cs b/Example/App.xaml.cs index 845426b..ca8f543 100644 --- a/Example/App.xaml.cs +++ b/Example/App.xaml.cs @@ -1,11 +1,9 @@ -using System.Windows; - -namespace Example +namespace Example { /// /// Interaction logic for App.xaml /// - public partial class App : Application + public partial class App { } } diff --git a/Example/MainWindow.xaml b/Example/MainWindow.xaml index 5e3da08..de75894 100644 --- a/Example/MainWindow.xaml +++ b/Example/MainWindow.xaml @@ -3,7 +3,6 @@ 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:Example" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Title="MainWindow" Width="800" diff --git a/Katteker.Test/Properties/AssemblyInfo.cs b/Katteker.Test/Properties/AssemblyInfo.cs index 12c86c0..94018c5 100644 --- a/Katteker.Test/Properties/AssemblyInfo.cs +++ b/Katteker.Test/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Katteker.Test")] diff --git a/Katteker/ChangelogHelper.cs b/Katteker/ChangelogHelper.cs index 2485a63..c89b26f 100644 --- a/Katteker/ChangelogHelper.cs +++ b/Katteker/ChangelogHelper.cs @@ -61,9 +61,13 @@ namespace Katteker try { using (var response = await webReq.GetResponseAsync().ConfigureAwait(false)) - using (var sr = new StreamReader(response.GetResponseStream())) { - return await sr.ReadToEndAsync().ConfigureAwait(false); + var responseStream = response.GetResponseStream(); + if (responseStream == null) return null; + using (var sr = new StreamReader(responseStream)) + { + return await sr.ReadToEndAsync().ConfigureAwait(false); + } } } catch (Exception) diff --git a/Katteker/ReleaseEntry.cs b/Katteker/ReleaseEntry.cs index 8ecdc2b..1797cae 100644 --- a/Katteker/ReleaseEntry.cs +++ b/Katteker/ReleaseEntry.cs @@ -1,6 +1,7 @@ using Semver; using System; using System.Collections.Generic; +using System.IO; using System.Text.RegularExpressions; namespace Katteker @@ -29,7 +30,7 @@ namespace Katteker /// /// Construct release entry from string. /// - /// + /// public ReleaseEntry(string line) { var elements = line?.Split(Seperator); @@ -38,7 +39,7 @@ namespace Katteker Filename = elements[1]; Filesize = long.Parse(elements[2]); var fileSegments = Regex.Match(Filename, FilenameRegex); - if (fileSegments.Groups.Count < 3) throw new ArgumentOutOfRangeException("Filename is not compilant."); + if (fileSegments.Groups.Count < 3) throw new FileLoadException("Filename not compilant."); ApplicationName = fileSegments.Groups[1].Value; Version = SemVersion.Parse(fileSegments.Groups[2].Value); IsDelta = fileSegments.Groups[3].Value != "full";