From 501e099ac99415c1605a378005a173f821b557ff Mon Sep 17 00:00:00 2001 From: emile_sonneveld Date: Wed, 16 Nov 2022 13:33:29 +0100 Subject: [PATCH] Clean up usings again. Fix linkName that may be null. --- BalsamiqFlowOverview.UnitTestProject/UnitTest1.cs | 6 +----- BalsamiqFlowOverview/BalsamiqBmml.cs | 4 +--- BalsamiqFlowOverview/FlowOverview.cs | 5 +---- BalsamiqFlowOverview/FlowScreen.cs | 7 +++---- BalsamiqFlowOverview/Program.cs | 6 +----- 5 files changed, 7 insertions(+), 21 deletions(-) diff --git a/BalsamiqFlowOverview.UnitTestProject/UnitTest1.cs b/BalsamiqFlowOverview.UnitTestProject/UnitTest1.cs index c8d5792..4e49c80 100644 --- a/BalsamiqFlowOverview.UnitTestProject/UnitTest1.cs +++ b/BalsamiqFlowOverview.UnitTestProject/UnitTest1.cs @@ -1,10 +1,6 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using System; +using Newtonsoft.Json; using System.Diagnostics; -using System.IO; using System.Runtime.CompilerServices; -using static System.Net.Mime.MediaTypeNames; namespace BalsamiqFlowOverview.UnitTestProject { diff --git a/BalsamiqFlowOverview/BalsamiqBmml.cs b/BalsamiqFlowOverview/BalsamiqBmml.cs index b7aa96f..327acbe 100644 --- a/BalsamiqFlowOverview/BalsamiqBmml.cs +++ b/BalsamiqFlowOverview/BalsamiqBmml.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; - -#pragma warning disable IDE1006 // Naming Styles +#pragma warning disable IDE1006 // Naming Styles // Classes used to parse JSON to plain old c# objects. // Code generated with: http://json2csharp.com/ diff --git a/BalsamiqFlowOverview/FlowOverview.cs b/BalsamiqFlowOverview/FlowOverview.cs index ad52f62..d17cac8 100644 --- a/BalsamiqFlowOverview/FlowOverview.cs +++ b/BalsamiqFlowOverview/FlowOverview.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Drawing; +using System.Drawing; using System.Text; -using System.Linq; namespace BalsamiqFlowOverview { diff --git a/BalsamiqFlowOverview/FlowScreen.cs b/BalsamiqFlowOverview/FlowScreen.cs index 2564d1b..e296193 100644 --- a/BalsamiqFlowOverview/FlowScreen.cs +++ b/BalsamiqFlowOverview/FlowScreen.cs @@ -1,14 +1,13 @@ -using System.Collections.Generic; -using System.Drawing; +using System.Drawing; namespace BalsamiqFlowOverview { class FlowLink { - public readonly string linkName; + public readonly string? linkName; public readonly FlowScreen screen; - public FlowLink(string linkName, FlowScreen screen) + public FlowLink(string? linkName, FlowScreen screen) { this.linkName = linkName; this.screen = screen; diff --git a/BalsamiqFlowOverview/Program.cs b/BalsamiqFlowOverview/Program.cs index f491c76..dd2f100 100644 --- a/BalsamiqFlowOverview/Program.cs +++ b/BalsamiqFlowOverview/Program.cs @@ -1,10 +1,6 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; using System.Data.SQLite; using System.Diagnostics; -using System.IO; -using System.Linq; namespace BalsamiqFlowOverview { @@ -117,7 +113,7 @@ Dictionary resources { foreach (var control in controls) { - string controlText = (control.properties?.text).ThrowIfNull(); + var controlText = control.properties?.text; foreach (var href in GetHrefs(control)) { var fl = new FlowLink(