Compartir a través de


ConnectionActiveState.SimilarConnection Propiedad

Definición

Obtiene un valor que indica si la conexión es similar.

public:
 property Microsoft::Web::Management::Client::ConnectionInfo ^ SimilarConnection { Microsoft::Web::Management::Client::ConnectionInfo ^ get(); };
public Microsoft.Web.Management.Client.ConnectionInfo SimilarConnection { get; }
member this.SimilarConnection : Microsoft.Web.Management.Client.ConnectionInfo
Public ReadOnly Property SimilarConnection As ConnectionInfo

Valor de propiedad

true si la conexión es similar; de lo contrario, false.

Ejemplos

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
                );
        }

    }
}

Se aplica a