Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

Product Family
Current publication

AFConnections.IsValidConnection Method (Boolean, Boolean, AFPort, AFPort, String)

Table of Contents
HomeAF SDK Reference...NamespacesOSIsoft.AF.ModelingAFConnections ClassAFConnections MethodsIsValidConnection Method AFConnections.IsValidConnection Method (Boolean, Boolean, AFPort, AFPort, String)Current page
TABLE OF CONTENTS

AFConnections.IsValidConnection Method (Boolean, Boolean, AFPort, AFPort, String)

AFConnections.IsValidConnection Method (Boolean, Boolean, AFPort, AFPort, String)
This method checks if a valid connection can be created between the specified source and destination ports of an AFBaseElement.

Namespace:  OSIsoft.AF.Modeling
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.0.1156

Syntax

public bool IsValidConnection(
	bool checkSourceMaxConnections,
	bool checkDestinationMaxConnections,
	AFPort sourcePort,
	AFPort destinationPort,
	out string errMsg
)
Public Function IsValidConnection ( 
	checkSourceMaxConnections As Boolean,
	checkDestinationMaxConnections As Boolean,
	sourcePort As AFPort,
	destinationPort As AFPort,
	<OutAttribute> ByRef errMsg As String
) As Boolean

Dim instance As AFConnections
Dim checkSourceMaxConnections As Boolean
Dim checkDestinationMaxConnections As Boolean
Dim sourcePort As AFPort
Dim destinationPort As AFPort
Dim errMsg As String
Dim returnValue As Boolean

returnValue = instance.IsValidConnection(checkSourceMaxConnections, 
	checkDestinationMaxConnections, 
	sourcePort, destinationPort, errMsg)
public:
bool IsValidConnection(
	bool checkSourceMaxConnections, 
	bool checkDestinationMaxConnections, 
	AFPort^ sourcePort, 
	AFPort^ destinationPort, 
	[OutAttribute] String^% errMsg
)
member IsValidConnection : 
        checkSourceMaxConnections : bool * 
        checkDestinationMaxConnections : bool * 
        sourcePort : AFPort * 
        destinationPort : AFPort * 
        errMsg : string byref -> bool 

Parameters

checkSourceMaxConnections
Type: System.Boolean
If true, check the source port to determine if the maximum number of connections will be exceeded. If false, this check will not be performed. You would not want to perform this check if you are attempting to check if the destination could be changed to a different port before removing the current connection. Normally this parameter should be set to true.
checkDestinationMaxConnections
Type: System.Boolean
If true, check the destination port to determine if the maximum number of connections will be exceeded. If false, this check will not be performed. You would not want to perform this check if you are attempting to check if the source could be changed to a different port before removing the current connection. Normally this parameter should be set to true.
sourcePort
Type: OSIsoft.AF.Modeling.AFPort
The source AFPort object of the connection. The port type must be either Output or Undirected. The port must be from an AFBaseElement, it cannot be from an AFElementTemplate.
destinationPort
Type: OSIsoft.AF.Modeling.AFPort
The destination AFPort object of the connection. The port type must be either Input or Undirected. The port must be from an AFBaseElement, it cannot be from an AFElementTemplate.
errMsg
Type: System.String
The returned error message if the connection is invalid.

Return Value

Type: Boolean
Returns true if the connection is valid. If the connection is invalid, returns false and the errMsg parameter specifies the error message.

Exceptions

ExceptionCondition
ArgumentNullException This exception is thrown when the sourcePort parameter or the destinationPort parameter is null.

Version Information

AFSDK


See Also

Was this topic helpful?