Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AirVisualNodeConnectorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<probing privatePath="bin" />
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.5.0" newVersion="1.2.5.0" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
Expand All @@ -20,7 +20,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<gcConcurrent enabled="true" />
Expand Down
15 changes: 12 additions & 3 deletions ConfigPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -284,6 +284,15 @@ private string BuildMainWebPageBody()
return stb.ToString();
}

private static string RedirectPageJS(string url)
{
StringBuilder stb = new StringBuilder();
stb.AppendLine("<script type='text/javascript'>");
stb.AppendLine(Invariant($"$(document).ready(function() {{ location.assign('{url}'); }});"));
stb.AppendLine("</script>");
return stb.ToString();
}

private const string AddNewName = "Add New";
private const string CancelDeviceName = "CancelDeviceName";
private const string DebugLoggingId = "DebugLoggingId";
Expand Down
2 changes: 1 addition & 1 deletion Connector/AirVisualNodeConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion DeviceData/DeviceRootDeviceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, DeviceData> currentChildDevices = new Dictionary<string, DeviceData>();
};
}
11 changes: 0 additions & 11 deletions FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<NullGuard />
<Costura>
<ExcludeAssemblies>
Scheduler
HomeSeerAPI
HSCF
ADODB
Interop.hsrecord2
NullGuard
Costura
</ExcludeAssemblies>
</Costura>
</Weavers>
91 changes: 5 additions & 86 deletions FodyWeavers.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
<xs:documentation>In explicit mode everything is assumed to be nullable, unless attributed with [NotNull].</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="NullableReferenceTypes">
<xs:annotation>
<xs:documentation>Use C# 8 nullable reference type annotations.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
Expand All @@ -42,92 +47,6 @@
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>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.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCompression" type="xs:boolean">
<xs:annotation>
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCleanup" type="xs:boolean">
<xs:annotation>
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
<xs:annotation>
<xs:documentation>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.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>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.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
Expand Down
2 changes: 1 addition & 1 deletion HSPIBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Loading