ConnectionActiveState.DifferentCredentials プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
資格情報が異なるかどうかを示す値を取得します。
public:
property bool DifferentCredentials { bool get(); };
public bool DifferentCredentials { get; }
member this.DifferentCredentials : bool
Public ReadOnly Property DifferentCredentials As Boolean
プロパティ値
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
);
}
}
}