Apply code style formatting and restore partial modifiers on Avalonia views
Linter/formatter pass across the full codebase. Restores required partial keyword on AXAML code-behind classes that the formatter incorrectly removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,12 +4,12 @@ using ZB.MOM.WW.LmxOpcUa.Client.Shared.Models;
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Client.Shared.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Maps the library's AggregateType enum to OPC UA aggregate function NodeIds.
|
||||
/// Maps the library's AggregateType enum to OPC UA aggregate function NodeIds.
|
||||
/// </summary>
|
||||
public static class AggregateTypeMapper
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the OPC UA NodeId for the specified aggregate type.
|
||||
/// Returns the OPC UA NodeId for the specified aggregate type.
|
||||
/// </summary>
|
||||
public static NodeId ToNodeId(AggregateType aggregate)
|
||||
{
|
||||
@@ -24,4 +24,4 @@ public static class AggregateTypeMapper
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(aggregate), aggregate, "Unknown AggregateType value.")
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Client.Shared.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Parses and normalizes failover URL sets for redundant OPC UA connections.
|
||||
/// Parses and normalizes failover URL sets for redundant OPC UA connections.
|
||||
/// </summary>
|
||||
public static class FailoverUrlParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses a comma-separated failover URL string, prepending the primary URL.
|
||||
/// Trims whitespace and deduplicates.
|
||||
/// Parses a comma-separated failover URL string, prepending the primary URL.
|
||||
/// Trims whitespace and deduplicates.
|
||||
/// </summary>
|
||||
/// <param name="primaryUrl">The primary endpoint URL.</param>
|
||||
/// <param name="failoverCsv">Optional comma-separated failover URLs.</param>
|
||||
@@ -15,7 +15,7 @@ public static class FailoverUrlParser
|
||||
public static string[] Parse(string primaryUrl, string? failoverCsv)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(failoverCsv))
|
||||
return new[] { primaryUrl };
|
||||
return [primaryUrl];
|
||||
|
||||
var urls = new List<string> { primaryUrl };
|
||||
foreach (var url in failoverCsv.Split(',', StringSplitOptions.RemoveEmptyEntries))
|
||||
@@ -24,11 +24,12 @@ public static class FailoverUrlParser
|
||||
if (!string.IsNullOrEmpty(trimmed) && !urls.Contains(trimmed, StringComparer.OrdinalIgnoreCase))
|
||||
urls.Add(trimmed);
|
||||
}
|
||||
|
||||
return urls.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds a failover URL set from the primary URL and an optional array of failover URLs.
|
||||
/// Builds a failover URL set from the primary URL and an optional array of failover URLs.
|
||||
/// </summary>
|
||||
/// <param name="primaryUrl">The primary endpoint URL.</param>
|
||||
/// <param name="failoverUrls">Optional failover URLs.</param>
|
||||
@@ -36,7 +37,7 @@ public static class FailoverUrlParser
|
||||
public static string[] Parse(string primaryUrl, string[]? failoverUrls)
|
||||
{
|
||||
if (failoverUrls == null || failoverUrls.Length == 0)
|
||||
return new[] { primaryUrl };
|
||||
return [primaryUrl];
|
||||
|
||||
var urls = new List<string> { primaryUrl };
|
||||
foreach (var url in failoverUrls)
|
||||
@@ -45,6 +46,7 @@ public static class FailoverUrlParser
|
||||
if (!string.IsNullOrEmpty(trimmed) && !urls.Contains(trimmed, StringComparer.OrdinalIgnoreCase))
|
||||
urls.Add(trimmed);
|
||||
}
|
||||
|
||||
return urls.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,12 @@ using ZB.MOM.WW.LmxOpcUa.Client.Shared.Models;
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Client.Shared.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Maps between the library's SecurityMode enum and OPC UA SDK MessageSecurityMode.
|
||||
/// Maps between the library's SecurityMode enum and OPC UA SDK MessageSecurityMode.
|
||||
/// </summary>
|
||||
public static class SecurityModeMapper
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a <see cref="SecurityMode"/> to an OPC UA <see cref="MessageSecurityMode"/>.
|
||||
/// Converts a <see cref="SecurityMode" /> to an OPC UA <see cref="MessageSecurityMode" />.
|
||||
/// </summary>
|
||||
public static MessageSecurityMode ToMessageSecurityMode(SecurityMode mode)
|
||||
{
|
||||
@@ -23,7 +23,7 @@ public static class SecurityModeMapper
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses a string to a <see cref="SecurityMode"/> value, case-insensitively.
|
||||
/// Parses a string to a <see cref="SecurityMode" /> value, case-insensitively.
|
||||
/// </summary>
|
||||
/// <param name="value">The string to parse (e.g., "none", "sign", "encrypt", "signandencrypt").</param>
|
||||
/// <returns>The corresponding SecurityMode.</returns>
|
||||
@@ -39,4 +39,4 @@ public static class SecurityModeMapper
|
||||
$"Unknown security mode '{value}'. Valid values: none, sign, encrypt, signandencrypt")
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Client.Shared.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Converts raw string values into typed values based on the current value's runtime type.
|
||||
/// Ported from the CLI tool's OpcUaHelper.ConvertValue.
|
||||
/// Converts raw string values into typed values based on the current value's runtime type.
|
||||
/// Ported from the CLI tool's OpcUaHelper.ConvertValue.
|
||||
/// </summary>
|
||||
public static class ValueConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a raw string value into the runtime type expected by the target node.
|
||||
/// Converts a raw string value into the runtime type expected by the target node.
|
||||
/// </summary>
|
||||
/// <param name="rawValue">The raw string supplied by the user.</param>
|
||||
/// <param name="currentValue">The current node value used to infer the target type. May be null.</param>
|
||||
@@ -29,4 +29,4 @@ public static class ValueConverter
|
||||
_ => rawValue
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user