fixed warnings.

This commit is contained in:
Holger Boerchers 2018-06-16 09:59:36 +02:00
parent ebc776459d
commit 92b32975e8
8 changed files with 12 additions and 13 deletions

View File

@ -1,5 +1,4 @@
using System;
using System.Threading;
namespace KattekerCreator.Helper
{

View File

@ -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

View File

@ -1,7 +1,6 @@
<Application x:Class="Example.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Example"
StartupUri="MainWindow.xaml">
<Application.Resources>

View File

@ -1,11 +1,9 @@
using System.Windows;
namespace Example
namespace Example
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
public partial class App
{
}
}

View File

@ -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"

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Katteker.Test")]

View File

@ -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)

View File

@ -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
/// <summary>
/// Construct release entry from string.
/// </summary>
/// <exception cref="ArgumentOutOfRangeException"></exception>
/// <exception cref="FileLoadException"></exception>
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";