Opc.Ua.Gds.QueryServersMethodState.Call C# (CSharp) Method

Call() protected method

Invokes the method, returns the result and output argument.
protected Call ( ISystemContext context, Opc.Ua.NodeId objectId, IList inputArguments, IList outputArguments ) : ServiceResult
context ISystemContext The current context.
objectId Opc.Ua.NodeId The id of the object.
inputArguments IList The input arguments which have been already validated.
outputArguments IList The output arguments which have initialized with thier default values.
return Opc.Ua.ServiceResult
        protected override ServiceResult Call(
            ISystemContext context,
            NodeId objectId,
            IList<object> inputArguments,
            IList<object> outputArguments)
        {
            if (OnCall == null)
            {
                return base.Call(context, objectId, inputArguments, outputArguments);
            }

            ServiceResult result = null;

            uint startingRecordId = (uint)inputArguments[0];
            uint maxRecordsToReturn = (uint)inputArguments[1];
            string applicationName = (string)inputArguments[2];
            string applicationUri = (string)inputArguments[3];
            string productUri = (string)inputArguments[4];
            string[] serverCapabilities = (string[])inputArguments[5];

            DateTime lastCounterResetTime = (DateTime)outputArguments[0];
            ServerOnNetwork[] servers = (ServerOnNetwork[])outputArguments[1];

            if (OnCall != null)
            {
                result = OnCall(
                    context,
                    this,
                    objectId,
                    startingRecordId,
                    maxRecordsToReturn,
                    applicationName,
                    applicationUri,
                    productUri,
                    serverCapabilities,
                    ref lastCounterResetTime,
                    ref servers);
            }

            outputArguments[0] = lastCounterResetTime;
            outputArguments[1] = servers;

            return result;
        }