diff --git a/AirVisualNodeConnectorManager.cs b/AirVisualNodeConnectorManager.cs index 571ca3c..5dcb3a4 100644 --- a/AirVisualNodeConnectorManager.cs +++ b/AirVisualNodeConnectorManager.cs @@ -100,6 +100,6 @@ private void SensorDataChanged(object sender, SensorData data) private readonly IHSApplication HS; private readonly DeviceRootDeviceManager rootDeviceData; private readonly AsyncLock rootDeviceDataLock = new AsyncLock(); - private bool disposedValue = false; // To detect redundant calls + private bool disposedValue; // To detect redundant calls } } \ No newline at end of file diff --git a/App.config b/App.config index 88e999a..a98f69e 100644 --- a/App.config +++ b/App.config @@ -8,7 +8,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/ConfigPage.cs b/ConfigPage.cs index 22f2aab..80883d9 100644 --- a/ConfigPage.cs +++ b/ConfigPage.cs @@ -141,18 +141,18 @@ public string PostBackProc(string data, [AllowNull]string user, int userRights) this.pluginConfig.AddDevice(device); this.pluginConfig.FireConfigChanged(); - this.divToUpdate.Add(SaveErrorDivId, RedirectPage(Invariant($"/{HttpUtility.UrlEncode(ConfigPage.Name)}"))); + this.divToUpdate.Add(SaveErrorDivId, RedirectPageJS(Invariant($"/{HttpUtility.UrlEncode(ConfigPage.Name)}"))); } } else if (form == NameToIdWithPrefix(CancelDeviceName)) { - this.divToUpdate.Add(SaveErrorDivId, RedirectPage(Invariant($"/{HttpUtility.UrlEncode(ConfigPage.Name)}"))); + this.divToUpdate.Add(SaveErrorDivId, RedirectPageJS(Invariant($"/{HttpUtility.UrlEncode(ConfigPage.Name)}"))); } else if (form == NameToIdWithPrefix(DeleteDeviceName)) { this.pluginConfig.RemoveDevice(parts[DeviceIdId]); this.pluginConfig.FireConfigChanged(); - this.divToUpdate.Add(SaveErrorDivId, RedirectPage(Invariant($"/{HttpUtility.UrlEncode(ConfigPage.Name)}"))); + this.divToUpdate.Add(SaveErrorDivId, RedirectPageJS(Invariant($"/{HttpUtility.UrlEncode(ConfigPage.Name)}"))); } else if (form == NameToIdWithPrefix(DebugLoggingId)) { @@ -284,6 +284,15 @@ private string BuildMainWebPageBody() return stb.ToString(); } + private static string RedirectPageJS(string url) + { + StringBuilder stb = new StringBuilder(); + stb.AppendLine(""); + return stb.ToString(); + } + private const string AddNewName = "Add New"; private const string CancelDeviceName = "CancelDeviceName"; private const string DebugLoggingId = "DebugLoggingId"; diff --git a/Connector/AirVisualNodeConnector.cs b/Connector/AirVisualNodeConnector.cs index 3ef00a4..cbd3f49 100644 --- a/Connector/AirVisualNodeConnector.cs +++ b/Connector/AirVisualNodeConnector.cs @@ -174,7 +174,7 @@ private void UpdateDelta(SensorData data) private readonly NetworkCredential credentials; private readonly CancellationTokenSource sourceShutdownToken; - private bool disposedValue = false; + private bool disposedValue; private DateTime lastUpdate; } } \ No newline at end of file diff --git a/DeviceData/DeviceRootDeviceManager.cs b/DeviceData/DeviceRootDeviceManager.cs index 24a86fe..b9fddcd 100644 --- a/DeviceData/DeviceRootDeviceManager.cs +++ b/DeviceData/DeviceRootDeviceManager.cs @@ -194,7 +194,7 @@ private DeviceClass CreateDevice(int? optionalParentRefId, string name, string d private readonly string rootDeviceId; private readonly string deviceName; private readonly IHSApplication HS; - private int? parentRefId = null; + private int? parentRefId; private readonly IDictionary currentChildDevices = new Dictionary(); }; } \ No newline at end of file diff --git a/FodyWeavers.xml b/FodyWeavers.xml index e148c8b..12e0515 100644 --- a/FodyWeavers.xml +++ b/FodyWeavers.xml @@ -1,15 +1,4 @@  - - - Scheduler - HomeSeerAPI - HSCF - ADODB - Interop.hsrecord2 - NullGuard - Costura - - \ No newline at end of file diff --git a/FodyWeavers.xsd b/FodyWeavers.xsd index 8955ace..8c914e0 100644 --- a/FodyWeavers.xsd +++ b/FodyWeavers.xsd @@ -32,6 +32,11 @@ In explicit mode everything is assumed to be nullable, unless attributed with [NotNull]. + + + Use C# 8 nullable reference type annotations. + + @@ -42,92 +47,6 @@ - - - - - - A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks - - - - - A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. - - - - - A list of unmanaged 32 bit assembly names to include, delimited with line breaks. - - - - - A list of unmanaged 64 bit assembly names to include, delimited with line breaks. - - - - - The order of preloaded assemblies, delimited with line breaks. - - - - - - This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. - - - - - Controls if .pdbs for reference assemblies are also embedded. - - - - - Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. - - - - - As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. - - - - - Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. - - - - - Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. - - - - - A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | - - - - - A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. - - - - - A list of unmanaged 32 bit assembly names to include, delimited with |. - - - - - A list of unmanaged 64 bit assembly names to include, delimited with |. - - - - - The order of preloaded assemblies, delimited with |. - - - - diff --git a/HSPIBase.cs b/HSPIBase.cs index 59657d3..194d8fd 100644 --- a/HSPIBase.cs +++ b/HSPIBase.cs @@ -334,6 +334,6 @@ private void DisconnectHspiConnection() private readonly bool supportMutipleInstances; private readonly bool supportsAddDevice; private readonly bool supportsMultipleInstancesSingleEXE; - private bool disposedValue = false; + private bool disposedValue; } } \ No newline at end of file diff --git a/HSPI_AirVisualNode.csproj b/HSPI_AirVisualNode.csproj index 886ecb3..fd09d52 100644 --- a/HSPI_AirVisualNode.csproj +++ b/HSPI_AirVisualNode.csproj @@ -1,12 +1,5 @@  - - - - - - - Debug @@ -81,105 +74,7 @@ - - packages\Costura.Fody.4.1.0\lib\net40\Costura.dll - - - packages\homeseer.1.2.8\lib\net45\HomeSeerAPI.dll - - - packages\homeseer.1.2.8\lib\net45\HSCF.dll - - - packages\Nito.AsyncEx.Coordination.5.0.0\lib\netstandard2.0\Nito.AsyncEx.Coordination.dll - - - packages\Nito.AsyncEx.Tasks.5.0.0\lib\netstandard2.0\Nito.AsyncEx.Tasks.dll - - - packages\Nito.Collections.Deque.1.0.4\lib\netstandard2.0\Nito.Collections.Deque.dll - - - packages\Nito.Disposables.2.0.1\lib\net461\Nito.Disposables.dll - - - packages\NullGuard.Fody.2.2.0\lib\net40\NullGuard.dll - - - packages\homeseer.1.2.8\lib\net45\Scheduler.dll - - - packages\SharpCifs.Std.0.2.13\lib\netstandard1.3\SharpCifs.Std.dll - - - - packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll - - - packages\System.Collections.Immutable.1.7.0\lib\netstandard2.0\System.Collections.Immutable.dll - - - - packages\System.Console.4.3.0\lib\net46\System.Console.dll - True - True - - - - - packages\System.IO.4.3.0\lib\net462\System.IO.dll - True - True - - - packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll - - - - packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll - True - True - - - packages\System.Net.NetworkInformation.4.3.0\lib\net46\System.Net.NetworkInformation.dll - True - True - - - packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll - True - True - - - - packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll - True - True - - - packages\System.Runtime.CompilerServices.Unsafe.4.7.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - - - packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll - True - True - - - packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll - True - True - - - packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - True - True - - @@ -212,7 +107,6 @@ - @@ -231,67 +125,125 @@ - - - - - - - - - + + 6.3.0 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 1.2.8 + + + 3.0.41 + + + 3.3.1 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 3.3.1 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 3.3.1 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 3.3.1 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 3.3.1 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 5.1.0 + + + 5.1.0 + + + 1.1.0 + + + 2.2.0 + + + 3.0.0 + + + 0.2.13 + + + 4.5.1 + + + 5.0.0 + + + 4.3.1 + + + 4.3.0 + + + 4.5.4 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.5.0 + + + 4.3.1 + + + 5.0.0 + + + 4.3.1 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + - - - - - - - - - - - - (); -var attribute = config.Attribute("ExcludeAssemblies"); -if (attribute != null) - foreach (var item in attribute.Value.Split('|').Select(x => x.Trim()).Where(x => x != string.Empty)) - excludedAssemblies.Add(item); -var element = config.Element("ExcludeAssemblies"); -if (element != null) - foreach (var item in element.Value.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).Where(x => x != string.Empty)) - excludedAssemblies.Add(item); - -var filesToCleanup = Files.Select(f => f.ItemSpec).Where(f => !excludedAssemblies.Contains(Path.GetFileNameWithoutExtension(f), StringComparer.InvariantCultureIgnoreCase)); - -foreach (var item in filesToCleanup) - File.Delete(item); -]]> - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - + + + + + + + + + + + + + + + + + +