Compartilhar via


ConnectionActiveState.DifferentCredentials Propriedade

Definição

Obtém um valor que indica se as credenciais são diferentes.

public:
 property bool DifferentCredentials { bool get(); };
public bool DifferentCredentials { get; }
member this.DifferentCredentials : bool
Public ReadOnly Property DifferentCredentials As Boolean

Valor da propriedade

true se as credenciais forem as mesmas; caso contrário, false.

Exemplos

void OpenConnection(IServiceProvider serviceProvider,
    ConnectionInfo newConnectionInfo) {

    if (newConnectionInfo != null) {
        IConnectionManager connectionManager =
            (IConnectionManager)
            serviceProvider.GetService(
            typeof(IConnectionManager)
            );

        if (connectionManager == null)
            return;

        using (new WaitCursor()) {
            ConnectionActiveState activeState =
                connectionManager.GetConnectionActiveState(
                newConnectionInfo);
            if (activeState.DifferentCredentials) {
                ShowMessage("ConnectionAlreadyExists",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
                newConnectionInfo = 
                    activeState.SimilarConnection;
            }

            MyActivateConnectionInfo(
                connectionManager,
                newConnectionInfo
                );
        }

    }
}

Aplica-se a