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

AF SDK Reference

AFCollective.SwitchMember Method (Boolean, IWin32Window, AFConnectionPreference)

AFCollective.SwitchMember Method (Boolean, IWin32Window, AFConnectionPreference)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFCollective.SwitchMember Method (Boolean, IWin32Window, AFConnectionPreference)
The SwitchMember method is used to change the currently connected member of the collective with a credential prompt if necessary.

Namespace:  OSIsoft.AF.Collective
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public void SwitchMember(
	bool autoPrompt,
	IWin32Window owner,
	AFConnectionPreference preference = AFConnectionPreference.Any
)
Public Sub SwitchMember ( 
	autoPrompt As Boolean,
	owner As IWin32Window,
	Optional preference As AFConnectionPreference = AFConnectionPreference.Any
)

Dim instance As AFCollective
Dim autoPrompt As Boolean
Dim owner As IWin32Window
Dim preference As AFConnectionPreference

instance.SwitchMember(autoPrompt, owner, 
	preference)
public:
void SwitchMember(
	bool autoPrompt, 
	IWin32Window^ owner, 
	AFConnectionPreference preference = AFConnectionPreference::Any
)
member SwitchMember : 
        autoPrompt : bool * 
        owner : IWin32Window * 
        ?preference : AFConnectionPreference 
(* Defaults:
        let _preference = defaultArg preference AFConnectionPreference.Any
*)
-> unit 

Parameters

autoPrompt
Type: SystemBoolean
If , then a dialog will be displayed to prompt for user credentials if the connection to the server fails.
owner
Type: System.Windows.FormsIWin32Window
The handle to the window that owns the credential prompt dialog. If , then the owner will be the desktop. This parameter is only used if autoPrompt is and there is a security error when attempting to connect to the PI AF Server.
preference (Optional)
Type: OSIsoft.AFAFConnectionPreference
The connection preference to use when determining which member of the AFCollective is selected for the connection. The current connection failover behavior is not modified. Use Any to switch to the next collective member based upon the current connection's failover behavior.

Remarks

This method will change the currently connected member of the collective based upon the AFConnectionInfo.Preference and AFCollectiveMember.Priority settings.

Version Information

AFSDK


See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in