ConnectionActiveState.SimilarConnection プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
接続が似ているかどうかを示す値を取得します。
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
プロパティ値
true
接続が似ている場合は 。それ以外の場合は false
。
例
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
);
}
}
}