From 3fcb5e419217dad02fcc0dcf1689a59607a26101 Mon Sep 17 00:00:00 2001 From: Martin Regen Date: Fri, 19 Jul 2024 10:51:25 +0200 Subject: [PATCH] fix formatting --- Libraries/Opc.Ua.Client/Session/Session.cs | 484 +++++++++--------- .../Opc.Ua.Client/Session/SessionAsync.cs | 46 +- 2 files changed, 254 insertions(+), 276 deletions(-) diff --git a/Libraries/Opc.Ua.Client/Session/Session.cs b/Libraries/Opc.Ua.Client/Session/Session.cs index 6d26b26a6..d9eb9842f 100644 --- a/Libraries/Opc.Ua.Client/Session/Session.cs +++ b/Libraries/Opc.Ua.Client/Session/Session.cs @@ -201,8 +201,7 @@ private void Initialize( m_preferredLocales = new string[] { CultureInfo.CurrentCulture.Name }; // create a context to use. - m_systemContext = new SystemContext - { + m_systemContext = new SystemContext { SystemHandle = this, EncodeableFactory = m_factory, NamespaceUris = m_namespaceUris, @@ -245,8 +244,7 @@ private void Initialize() m_reconnecting = false; m_reconnectLock = new SemaphoreSlim(1, 1); - m_defaultSubscription = new Subscription - { + m_defaultSubscription = new Subscription { DisplayName = "Subscription", PublishingInterval = 1000, KeepAliveCount = 10, @@ -1940,8 +1938,7 @@ public void ReadNodes( // first read only nodeclasses for nodes from server. var itemsToRead = new ReadValueIdCollection( nodeIds.Select(nodeId => - new ReadValueId - { + new ReadValueId { NodeId = nodeId, AttributeId = Attributes.NodeClass })); @@ -2023,8 +2020,7 @@ public Node ReadNode( ReadValueIdCollection itemsToRead = new ReadValueIdCollection(); foreach (uint attributeId in attributes.Keys) { - ReadValueId itemToRead = new ReadValueId - { + ReadValueId itemToRead = new ReadValueId { NodeId = nodeId, AttributeId = attributeId }; @@ -2052,8 +2048,7 @@ public Node ReadNode( /// public DataValue ReadValue(NodeId nodeId) { - ReadValueId itemToRead = new ReadValueId - { + ReadValueId itemToRead = new ReadValueId { NodeId = nodeId, AttributeId = Attributes.Value }; @@ -2102,8 +2097,7 @@ public void ReadValues( // read all values from server. var itemsToRead = new ReadValueIdCollection( nodeIds.Select(nodeId => - new ReadValueId - { + new ReadValueId { NodeId = nodeId, AttributeId = Attributes.Value })); @@ -2344,8 +2338,7 @@ public void Open( // send the application instance certificate for the client. BuildCertificateData(out byte[] clientCertificateData, out byte[] clientCertificateChainData); - ApplicationDescription clientDescription = new ApplicationDescription - { + ApplicationDescription clientDescription = new ApplicationDescription { ApplicationUri = m_configuration.ApplicationUri, ApplicationName = m_configuration.ApplicationName, ApplicationType = ApplicationType.Client, @@ -3053,8 +3046,7 @@ public virtual StatusCode Close(int timeout, bool closeChannel) try { // close the session and delete all subscriptions if specified. - var requestHeader = new RequestHeader() - { + var requestHeader = new RequestHeader() { TimeoutHint = timeout > 0 ? (uint)timeout : (uint)(this.OperationTimeout > 0 ? this.OperationTimeout : 0), }; CloseSession(requestHeader, m_deleteSubscriptionsOnClose); @@ -3391,8 +3383,7 @@ public virtual ResponseHeader Browse( BrowseDescriptionCollection browseDescription = new BrowseDescriptionCollection(); foreach (var nodeToBrowse in nodesToBrowse) { - BrowseDescription description = new BrowseDescription - { + BrowseDescription description = new BrowseDescription { NodeId = nodeToBrowse, BrowseDirection = browseDirection, ReferenceTypeId = referenceTypeId, @@ -3912,8 +3903,7 @@ private void OnSendKeepAlive(ReadValueIdCollection nodesToRead) } } - RequestHeader requestHeader = new RequestHeader - { + RequestHeader requestHeader = new RequestHeader { RequestHandle = Utils.IncrementIdentifier(ref m_keepAliveCounter), TimeoutHint = (uint)(KeepAliveInterval * 2), ReturnDiagnostics = 0 @@ -4126,8 +4116,7 @@ private void CreateNodeClassAttributesReadNodesRequest( var attributes = CreateAttributes(node.NodeClass, optionalAttributes); foreach (uint attributeId in attributes.Keys) { - ReadValueId itemToRead = new ReadValueId - { + ReadValueId itemToRead = new ReadValueId { NodeId = node.NodeId, AttributeId = attributeId }; @@ -4147,8 +4136,7 @@ private ReadValueIdCollection PrepareNamespaceTableNodesToRead() var nodesToRead = new ReadValueIdCollection(); // request namespace array. - ReadValueId valueId = new ReadValueId - { + ReadValueId valueId = new ReadValueId { NodeId = Variables.Server_NamespaceArray, AttributeId = Attributes.Value }; @@ -4156,8 +4144,7 @@ private ReadValueIdCollection PrepareNamespaceTableNodesToRead() nodesToRead.Add(valueId); // request server array. - valueId = new ReadValueId - { + valueId = new ReadValueId { NodeId = Variables.Server_ServerArray, AttributeId = Attributes.Value }; @@ -4242,8 +4229,7 @@ bool optionalAttributes var attributes = CreateAttributes(node.NodeClass, optionalAttributes); foreach (uint attributeId in attributes.Keys) { - ReadValueId itemToRead = new ReadValueId - { + ReadValueId itemToRead = new ReadValueId { NodeId = node.NodeId, AttributeId = attributeId }; @@ -4375,294 +4361,294 @@ private Node ProcessReadResponse( switch ((NodeClass)nodeClass.Value) { default: - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Node does not have a valid value for NodeClass: {0}.", nodeClass.Value); - } + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Node does not have a valid value for NodeClass: {0}.", nodeClass.Value); + } case NodeClass.Object: - { - ObjectNode objectNode = new ObjectNode(); - - value = attributes[Attributes.EventNotifier]; + { + ObjectNode objectNode = new ObjectNode(); - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Object does not support the EventNotifier attribute."); - } + value = attributes[Attributes.EventNotifier]; - objectNode.EventNotifier = (byte)value.GetValue(typeof(byte)); - node = objectNode; - break; + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Object does not support the EventNotifier attribute."); } - case NodeClass.ObjectType: - { - ObjectTypeNode objectTypeNode = new ObjectTypeNode(); + objectNode.EventNotifier = (byte)value.GetValue(typeof(byte)); + node = objectNode; + break; + } - value = attributes[Attributes.IsAbstract]; + case NodeClass.ObjectType: + { + ObjectTypeNode objectTypeNode = new ObjectTypeNode(); - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "ObjectType does not support the IsAbstract attribute."); - } + value = attributes[Attributes.IsAbstract]; - objectTypeNode.IsAbstract = (bool)value.GetValue(typeof(bool)); - node = objectTypeNode; - break; + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "ObjectType does not support the IsAbstract attribute."); } + objectTypeNode.IsAbstract = (bool)value.GetValue(typeof(bool)); + node = objectTypeNode; + break; + } + case NodeClass.Variable: - { - VariableNode variableNode = new VariableNode(); + { + VariableNode variableNode = new VariableNode(); - // DataType Attribute - value = attributes[Attributes.DataType]; + // DataType Attribute + value = attributes[Attributes.DataType]; - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the DataType attribute."); - } + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the DataType attribute."); + } - variableNode.DataType = (NodeId)value.GetValue(typeof(NodeId)); + variableNode.DataType = (NodeId)value.GetValue(typeof(NodeId)); - // ValueRank Attribute - value = attributes[Attributes.ValueRank]; + // ValueRank Attribute + value = attributes[Attributes.ValueRank]; - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the ValueRank attribute."); - } + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the ValueRank attribute."); + } - variableNode.ValueRank = (int)value.GetValue(typeof(int)); + variableNode.ValueRank = (int)value.GetValue(typeof(int)); - // ArrayDimensions Attribute - value = attributes[Attributes.ArrayDimensions]; + // ArrayDimensions Attribute + value = attributes[Attributes.ArrayDimensions]; - if (value != null) + if (value != null) + { + if (value.Value == null) { - if (value.Value == null) - { - variableNode.ArrayDimensions = Array.Empty(); - } - else - { - variableNode.ArrayDimensions = (uint[])value.GetValue(typeof(uint[])); - } + variableNode.ArrayDimensions = Array.Empty(); } - - // AccessLevel Attribute - value = attributes[Attributes.AccessLevel]; - - if (value == null) + else { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the AccessLevel attribute."); + variableNode.ArrayDimensions = (uint[])value.GetValue(typeof(uint[])); } + } - variableNode.AccessLevel = (byte)value.GetValue(typeof(byte)); - - // UserAccessLevel Attribute - value = attributes[Attributes.UserAccessLevel]; + // AccessLevel Attribute + value = attributes[Attributes.AccessLevel]; - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the UserAccessLevel attribute."); - } + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the AccessLevel attribute."); + } - variableNode.UserAccessLevel = (byte)value.GetValue(typeof(byte)); + variableNode.AccessLevel = (byte)value.GetValue(typeof(byte)); - // Historizing Attribute - value = attributes[Attributes.Historizing]; + // UserAccessLevel Attribute + value = attributes[Attributes.UserAccessLevel]; - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the Historizing attribute."); - } + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the UserAccessLevel attribute."); + } - variableNode.Historizing = (bool)value.GetValue(typeof(bool)); + variableNode.UserAccessLevel = (byte)value.GetValue(typeof(byte)); - // MinimumSamplingInterval Attribute - value = attributes[Attributes.MinimumSamplingInterval]; + // Historizing Attribute + value = attributes[Attributes.Historizing]; - if (value != null) - { - variableNode.MinimumSamplingInterval = Convert.ToDouble(attributes[Attributes.MinimumSamplingInterval].Value, CultureInfo.InvariantCulture); - } + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Variable does not support the Historizing attribute."); + } - // AccessLevelEx Attribute - value = attributes[Attributes.AccessLevelEx]; + variableNode.Historizing = (bool)value.GetValue(typeof(bool)); - if (value != null) - { - variableNode.AccessLevelEx = (uint)value.GetValue(typeof(uint)); - } + // MinimumSamplingInterval Attribute + value = attributes[Attributes.MinimumSamplingInterval]; - node = variableNode; - break; + if (value != null) + { + variableNode.MinimumSamplingInterval = Convert.ToDouble(attributes[Attributes.MinimumSamplingInterval].Value, CultureInfo.InvariantCulture); } - case NodeClass.VariableType: + // AccessLevelEx Attribute + value = attributes[Attributes.AccessLevelEx]; + + if (value != null) { - VariableTypeNode variableTypeNode = new VariableTypeNode(); + variableNode.AccessLevelEx = (uint)value.GetValue(typeof(uint)); + } - // IsAbstract Attribute - value = attributes[Attributes.IsAbstract]; + node = variableNode; + break; + } - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "VariableType does not support the IsAbstract attribute."); - } + case NodeClass.VariableType: + { + VariableTypeNode variableTypeNode = new VariableTypeNode(); - variableTypeNode.IsAbstract = (bool)value.GetValue(typeof(bool)); + // IsAbstract Attribute + value = attributes[Attributes.IsAbstract]; - // DataType Attribute - value = attributes[Attributes.DataType]; + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "VariableType does not support the IsAbstract attribute."); + } - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "VariableType does not support the DataType attribute."); - } + variableTypeNode.IsAbstract = (bool)value.GetValue(typeof(bool)); + + // DataType Attribute + value = attributes[Attributes.DataType]; - variableTypeNode.DataType = (NodeId)value.GetValue(typeof(NodeId)); + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "VariableType does not support the DataType attribute."); + } - // ValueRank Attribute - value = attributes[Attributes.ValueRank]; + variableTypeNode.DataType = (NodeId)value.GetValue(typeof(NodeId)); - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "VariableType does not support the ValueRank attribute."); - } + // ValueRank Attribute + value = attributes[Attributes.ValueRank]; - variableTypeNode.ValueRank = (int)value.GetValue(typeof(int)); + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "VariableType does not support the ValueRank attribute."); + } - // ArrayDimensions Attribute - value = attributes[Attributes.ArrayDimensions]; + variableTypeNode.ValueRank = (int)value.GetValue(typeof(int)); - if (value != null && value.Value != null) - { - variableTypeNode.ArrayDimensions = (uint[])value.GetValue(typeof(uint[])); - } + // ArrayDimensions Attribute + value = attributes[Attributes.ArrayDimensions]; - node = variableTypeNode; - break; + if (value != null && value.Value != null) + { + variableTypeNode.ArrayDimensions = (uint[])value.GetValue(typeof(uint[])); } + node = variableTypeNode; + break; + } + case NodeClass.Method: - { - MethodNode methodNode = new MethodNode(); + { + MethodNode methodNode = new MethodNode(); - // Executable Attribute - value = attributes[Attributes.Executable]; + // Executable Attribute + value = attributes[Attributes.Executable]; - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Method does not support the Executable attribute."); - } + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Method does not support the Executable attribute."); + } - methodNode.Executable = (bool)value.GetValue(typeof(bool)); + methodNode.Executable = (bool)value.GetValue(typeof(bool)); - // UserExecutable Attribute - value = attributes[Attributes.UserExecutable]; + // UserExecutable Attribute + value = attributes[Attributes.UserExecutable]; - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Method does not support the UserExecutable attribute."); - } + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "Method does not support the UserExecutable attribute."); + } - methodNode.UserExecutable = (bool)value.GetValue(typeof(bool)); + methodNode.UserExecutable = (bool)value.GetValue(typeof(bool)); - node = methodNode; - break; - } + node = methodNode; + break; + } case NodeClass.DataType: - { - DataTypeNode dataTypeNode = new DataTypeNode(); + { + DataTypeNode dataTypeNode = new DataTypeNode(); - // IsAbstract Attribute - value = attributes[Attributes.IsAbstract]; + // IsAbstract Attribute + value = attributes[Attributes.IsAbstract]; - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "DataType does not support the IsAbstract attribute."); - } - - dataTypeNode.IsAbstract = (bool)value.GetValue(typeof(bool)); + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "DataType does not support the IsAbstract attribute."); + } - // DataTypeDefinition Attribute - value = attributes[Attributes.DataTypeDefinition]; + dataTypeNode.IsAbstract = (bool)value.GetValue(typeof(bool)); - if (value != null) - { - dataTypeNode.DataTypeDefinition = value.Value as ExtensionObject; - } + // DataTypeDefinition Attribute + value = attributes[Attributes.DataTypeDefinition]; - node = dataTypeNode; - break; + if (value != null) + { + dataTypeNode.DataTypeDefinition = value.Value as ExtensionObject; } - case NodeClass.ReferenceType: - { - ReferenceTypeNode referenceTypeNode = new ReferenceTypeNode(); + node = dataTypeNode; + break; + } - // IsAbstract Attribute - value = attributes[Attributes.IsAbstract]; + case NodeClass.ReferenceType: + { + ReferenceTypeNode referenceTypeNode = new ReferenceTypeNode(); - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "ReferenceType does not support the IsAbstract attribute."); - } + // IsAbstract Attribute + value = attributes[Attributes.IsAbstract]; - referenceTypeNode.IsAbstract = (bool)value.GetValue(typeof(bool)); + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "ReferenceType does not support the IsAbstract attribute."); + } - // Symmetric Attribute - value = attributes[Attributes.Symmetric]; + referenceTypeNode.IsAbstract = (bool)value.GetValue(typeof(bool)); - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "ReferenceType does not support the Symmetric attribute."); - } + // Symmetric Attribute + value = attributes[Attributes.Symmetric]; - referenceTypeNode.Symmetric = (bool)value.GetValue(typeof(bool)); + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "ReferenceType does not support the Symmetric attribute."); + } - // InverseName Attribute - value = attributes[Attributes.InverseName]; + referenceTypeNode.Symmetric = (bool)value.GetValue(typeof(bool)); - if (value != null && value.Value != null) - { - referenceTypeNode.InverseName = (LocalizedText)value.GetValue(typeof(LocalizedText)); - } + // InverseName Attribute + value = attributes[Attributes.InverseName]; - node = referenceTypeNode; - break; + if (value != null && value.Value != null) + { + referenceTypeNode.InverseName = (LocalizedText)value.GetValue(typeof(LocalizedText)); } + node = referenceTypeNode; + break; + } + case NodeClass.View: - { - ViewNode viewNode = new ViewNode(); + { + ViewNode viewNode = new ViewNode(); - // EventNotifier Attribute - value = attributes[Attributes.EventNotifier]; + // EventNotifier Attribute + value = attributes[Attributes.EventNotifier]; - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "View does not support the EventNotifier attribute."); - } + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "View does not support the EventNotifier attribute."); + } - viewNode.EventNotifier = (byte)value.GetValue(typeof(byte)); + viewNode.EventNotifier = (byte)value.GetValue(typeof(byte)); - // ContainsNoLoops Attribute - value = attributes[Attributes.ContainsNoLoops]; + // ContainsNoLoops Attribute + value = attributes[Attributes.ContainsNoLoops]; - if (value == null) - { - throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "View does not support the ContainsNoLoops attribute."); - } + if (value == null) + { + throw ServiceResultException.Create(StatusCodes.BadUnexpectedError, "View does not support the ContainsNoLoops attribute."); + } - viewNode.ContainsNoLoops = (bool)value.GetValue(typeof(bool)); + viewNode.ContainsNoLoops = (bool)value.GetValue(typeof(bool)); - node = viewNode; - break; - } + node = viewNode; + break; + } } // NodeId Attribute @@ -4925,16 +4911,14 @@ public IAsyncResult BeginPublish(int timeout) timeoutHint = Math.Min((uint)(OperationTimeout / 2), timeoutHint); // send publish request. - var requestHeader = new RequestHeader - { + var requestHeader = new RequestHeader { // ensure the publish request is discarded before the timeout occurs to ensure the channel is dropped. TimeoutHint = timeoutHint, ReturnDiagnostics = (uint)(int)ReturnDiagnostics, RequestHandle = Utils.IncrementIdentifier(ref m_publishCounter) }; - var state = new AsyncRequestState - { + var state = new AsyncRequestState { RequestTypeId = DataTypes.PublishRequest, RequestId = requestHeader.RequestHandle, TickCount = HiResClock.TickCount @@ -5148,8 +5132,7 @@ private void OnPublishComplete(IAsyncResult result) case StatusCodes.BadTcpServerTooBusy: case StatusCodes.BadServerTooBusy: // throttle the next publish to reduce server load - _ = Task.Run(async () => - { + _ = Task.Run(async () => { await Task.Delay(100).ConfigureAwait(false); QueueBeginPublish(); }); @@ -5175,8 +5158,7 @@ public bool Republish(uint subscriptionId, uint sequenceNumber, out ServiceResul error = ServiceResult.Good; // send republish request. - RequestHeader requestHeader = new RequestHeader - { + RequestHeader requestHeader = new RequestHeader { TimeoutHint = (uint)OperationTimeout, ReturnDiagnostics = (uint)(int)ReturnDiagnostics, RequestHandle = Utils.IncrementIdentifier(ref m_publishCounter) @@ -6010,8 +5992,7 @@ private void ProcessPublishResponse( { NotificationEventArgs args = new NotificationEventArgs(subscription, notificationMessage, responseHeader.StringTable); - Task.Run(() => - { + Task.Run(() => { OnRaisePublishNotification(publishEventHandler, args); }); } @@ -6023,8 +6004,7 @@ private void ProcessPublishResponse( // Delete abandoned subscription from server. Utils.LogWarning("Received Publish Response for Unknown SubscriptionId={0}. Deleting abandoned subscription from server.", subscriptionId); - Task.Run(() => - { + Task.Run(() => { DeleteSubscription(subscriptionId); }); } @@ -6235,8 +6215,7 @@ private void AddAcknowledgementToSend(SubscriptionAcknowledgementCollection ackn Debug.Assert(Monitor.IsEntered(m_acknowledgementsToSendLock)); - SubscriptionAcknowledgement acknowledgement = new SubscriptionAcknowledgement - { + SubscriptionAcknowledgement acknowledgement = new SubscriptionAcknowledgement { SubscriptionId = subscriptionId, SequenceNumber = sequenceNumber }; @@ -6308,8 +6287,7 @@ private CallMethodRequestCollection CreateCallRequestsForResendData(IEnumerable< new Variant(subscription.Id) }; - var request = new CallMethodRequest - { + var request = new CallMethodRequest { ObjectId = ObjectIds.Server, MethodId = MethodIds.Server_ResendData, InputArguments = inputArguments @@ -6403,16 +6381,16 @@ private RequestHeader CreateRequestHeaderPerUserTokenPolicy(string identityToken return requestHeader; } - #endregion + #endregion - #region Protected Methods - /// - /// Process the AdditionalHeader field of a ResponseHeader - /// - /// - /// - /// - protected virtual void ProcessResponseAdditionalHeader(ResponseHeader responseHeader, X509Certificate2 serverCertificate) + #region Protected Methods + /// + /// Process the AdditionalHeader field of a ResponseHeader + /// + /// + /// + /// + protected virtual void ProcessResponseAdditionalHeader(ResponseHeader responseHeader, X509Certificate2 serverCertificate) { AdditionalParametersType parameters = ExtensionObject.ToEncodeable(responseHeader?.AdditionalHeader) as AdditionalParametersType; diff --git a/Libraries/Opc.Ua.Client/Session/SessionAsync.cs b/Libraries/Opc.Ua.Client/Session/SessionAsync.cs index d916a19bb..5187b2304 100644 --- a/Libraries/Opc.Ua.Client/Session/SessionAsync.cs +++ b/Libraries/Opc.Ua.Client/Session/SessionAsync.cs @@ -340,9 +340,9 @@ public async Task OpenAsync( throw; } } -#endregion + #endregion -#region Subscription Async Methods + #region Subscription Async Methods /// public async Task RemoveSubscriptionAsync(Subscription subscription, CancellationToken ct = default) { @@ -569,9 +569,9 @@ public async Task TransferSubscriptionsAsync( return failedSubscriptions == 0; } -#endregion + #endregion -#region FetchNamespaceTables Async Methods + #region FetchNamespaceTables Async Methods /// public async Task FetchNamespaceTablesAsync(CancellationToken ct = default) { @@ -594,9 +594,9 @@ public async Task FetchNamespaceTablesAsync(CancellationToken ct = default) UpdateNamespaceTable(values, diagnosticInfos, responseHeader); } -#endregion + #endregion -#region FetchTypeTree Async Methods + #region FetchTypeTree Async Methods /// public async Task FetchTypeTreeAsync(ExpandedNodeId typeId, CancellationToken ct = default) { @@ -640,9 +640,9 @@ public async Task FetchTypeTreeAsync(ExpandedNodeIdCollection typeIds, Cancellat await FetchTypeTreeAsync(subTypes, ct).ConfigureAwait(false); } } -#endregion + #endregion -#region FetchOperationLimits Async Methods + #region FetchOperationLimits Async Methods /// /// Fetch the operation limits of the server. /// @@ -695,9 +695,9 @@ public async Task FetchOperationLimitsAsync(CancellationToken ct) } } } -#endregion + #endregion -#region ReadNode Async Methods + #region ReadNode Async Methods /// public async Task<(IList, IList)> ReadNodesAsync( IList nodeIds, @@ -948,9 +948,9 @@ public async Task ReadValueAsync( return (values, errors); } -#endregion + #endregion -#region Browse Methods + #region Browse Methods /// public async Task<( ResponseHeader responseHeader, @@ -1019,9 +1019,9 @@ IList errors return (browseResponse.ResponseHeader, continuationPoints, referencesList, errors); } -#endregion + #endregion -#region BrowseNext Methods + #region BrowseNext Methods /// public async Task<( @@ -1070,9 +1070,9 @@ List errors return (response.ResponseHeader, revisedContinuationPoints, referencesList, errors); } -#endregion + #endregion -#region Call Methods + #region Call Methods /// public async Task> CallAsync(NodeId objectId, NodeId methodId, CancellationToken ct = default, params object[] args) { @@ -1120,9 +1120,9 @@ public async Task> CallAsync(NodeId objectId, NodeId methodId, Can return outputArguments; } -#endregion + #endregion -#region FetchReferences Async Methods + #region FetchReferences Async Methods /// public async Task FetchReferencesAsync( NodeId nodeId, @@ -1247,9 +1247,9 @@ IList browseNextErrors return (result, errors); } -#endregion + #endregion -#region Recreate Async Methods + #region Recreate Async Methods /// /// Recreates a session based on a specified template. /// @@ -1389,9 +1389,9 @@ await session.OpenAsync( return session; } -#endregion + #endregion -#region Close Async Methods + #region Close Async Methods /// public override Task CloseAsync(CancellationToken ct = default) { @@ -1480,7 +1480,7 @@ public virtual async Task CloseAsync(int timeout, bool closeChannel, return result; } -#endregion + #endregion #region Reconnect Async Methods ///