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:
@@ -5,17 +5,8 @@ namespace ZB.MOM.WW.LmxOpcUa.Client.Shared.Tests.Fakes;
|
||||
|
||||
internal sealed class FakeSessionAdapter : ISessionAdapter
|
||||
{
|
||||
private readonly List<FakeSubscriptionAdapter> _createdSubscriptions = [];
|
||||
private Action<bool>? _keepAliveCallback;
|
||||
private readonly List<FakeSubscriptionAdapter> _createdSubscriptions = new();
|
||||
|
||||
public bool Connected { get; set; } = true;
|
||||
public string SessionId { get; set; } = "ns=0;i=12345";
|
||||
public string SessionName { get; set; } = "FakeSession";
|
||||
public string EndpointUrl { get; set; } = "opc.tcp://localhost:4840";
|
||||
public string ServerName { get; set; } = "FakeServer";
|
||||
public string SecurityMode { get; set; } = "None";
|
||||
public string SecurityPolicyUri { get; set; } = "http://opcfoundation.org/UA/SecurityPolicy#None";
|
||||
public NamespaceTable NamespaceUris { get; set; } = new();
|
||||
|
||||
public bool Closed { get; private set; }
|
||||
public bool Disposed { get; private set; }
|
||||
@@ -35,38 +26,39 @@ internal sealed class FakeSessionAdapter : ISessionAdapter
|
||||
public bool ThrowOnWrite { get; set; }
|
||||
public bool ThrowOnBrowse { get; set; }
|
||||
|
||||
public ReferenceDescriptionCollection BrowseResponse { get; set; } = new();
|
||||
public ReferenceDescriptionCollection BrowseResponse { get; set; } = [];
|
||||
public byte[]? BrowseContinuationPoint { get; set; }
|
||||
public ReferenceDescriptionCollection BrowseNextResponse { get; set; } = new();
|
||||
public ReferenceDescriptionCollection BrowseNextResponse { get; set; } = [];
|
||||
public byte[]? BrowseNextContinuationPoint { get; set; }
|
||||
public bool HasChildrenResponse { get; set; } = false;
|
||||
|
||||
public List<DataValue> HistoryReadRawResponse { get; set; } = new();
|
||||
public List<DataValue> HistoryReadAggregateResponse { get; set; } = new();
|
||||
public List<DataValue> HistoryReadRawResponse { get; set; } = [];
|
||||
public List<DataValue> HistoryReadAggregateResponse { get; set; } = [];
|
||||
public bool ThrowOnHistoryReadRaw { get; set; }
|
||||
public bool ThrowOnHistoryReadAggregate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The next FakeSubscriptionAdapter to return from CreateSubscriptionAsync.
|
||||
/// If null, a new one is created automatically.
|
||||
/// The next FakeSubscriptionAdapter to return from CreateSubscriptionAsync.
|
||||
/// If null, a new one is created automatically.
|
||||
/// </summary>
|
||||
public FakeSubscriptionAdapter? NextSubscription { get; set; }
|
||||
|
||||
public IReadOnlyList<FakeSubscriptionAdapter> CreatedSubscriptions => _createdSubscriptions;
|
||||
|
||||
public bool Connected { get; set; } = true;
|
||||
public string SessionId { get; set; } = "ns=0;i=12345";
|
||||
public string SessionName { get; set; } = "FakeSession";
|
||||
public string EndpointUrl { get; set; } = "opc.tcp://localhost:4840";
|
||||
public string ServerName { get; set; } = "FakeServer";
|
||||
public string SecurityMode { get; set; } = "None";
|
||||
public string SecurityPolicyUri { get; set; } = "http://opcfoundation.org/UA/SecurityPolicy#None";
|
||||
public NamespaceTable NamespaceUris { get; set; } = new();
|
||||
|
||||
public void RegisterKeepAliveHandler(Action<bool> callback)
|
||||
{
|
||||
_keepAliveCallback = callback;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Simulates a keep-alive event.
|
||||
/// </summary>
|
||||
public void SimulateKeepAlive(bool isGood)
|
||||
{
|
||||
_keepAliveCallback?.Invoke(isGood);
|
||||
}
|
||||
|
||||
public Task<DataValue> ReadValueAsync(NodeId nodeId, CancellationToken ct)
|
||||
{
|
||||
ReadCount++;
|
||||
@@ -119,7 +111,8 @@ internal sealed class FakeSessionAdapter : ISessionAdapter
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<DataValue>> HistoryReadAggregateAsync(
|
||||
NodeId nodeId, DateTime startTime, DateTime endTime, NodeId aggregateId, double intervalMs, CancellationToken ct)
|
||||
NodeId nodeId, DateTime startTime, DateTime endTime, NodeId aggregateId, double intervalMs,
|
||||
CancellationToken ct)
|
||||
{
|
||||
HistoryReadAggregateCount++;
|
||||
if (ThrowOnHistoryReadAggregate)
|
||||
@@ -147,4 +140,12 @@ internal sealed class FakeSessionAdapter : ISessionAdapter
|
||||
Disposed = true;
|
||||
Connected = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Simulates a keep-alive event.
|
||||
/// </summary>
|
||||
public void SimulateKeepAlive(bool isGood)
|
||||
{
|
||||
_keepAliveCallback?.Invoke(isGood);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user