CheckForUpdateCompletedEventArgs.MinimumRequiredVersion プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CheckForUpdateCompletedEventArgs.MinimumRequiredVersion プロパティの意味・解説 

CheckForUpdateCompletedEventArgs.MinimumRequiredVersion プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ユーザーコンピュータインストールしておく必要のある最小バージョン取得します

名前空間: System.Deployment.Application
アセンブリ: System.Deployment (system.deployment.dll 内)
構文構文

Public ReadOnly Property
 MinimumRequiredVersion As Version
Dim instance As CheckForUpdateCompletedEventArgs
Dim value As Version

value = instance.MinimumRequiredVersion
public Version MinimumRequiredVersion { get;
 }
public:
property Version^ MinimumRequiredVersion {
    Version^ get ();
}
/** @property */
public Version get_MinimumRequiredVersion ()
public function get MinimumRequiredVersion
 () : Version

プロパティ
すべてのユーザーインストールしておく必要のある最も古いバージョンを表す Version オブジェクト

解説解説
使用例使用例

CheckForUpdateAsync を呼び出してMinimumRequiredVersion が CurrentVersion より大きい場合は、強制的にアプリケーション更新するコード例次に示します

Dim WithEvents ADCheckForUpdateAsyncMin As
 ApplicationDeployment

Private Sub CheckForUpdateAsyncMin()
    If (ApplicationDeployment.IsNetworkDeployed) Then
        ADCheckForUpdateAsyncMin = ApplicationDeployment.CurrentDeployment

        ADCheckForUpdateAsyncMin.CheckForUpdate()
    End If
End Sub


Sub ADCheckForUpdateAsyncMin_CheckForUpdateCompleted(ByVal
 sender As Object, ByVal
 e As CheckForUpdateCompletedEventArgs) Handles ADCheckForUpdateAsyncMin.CheckForUpdateCompleted
    If Not (e.Error Is Nothing)
 Then
        MessageBox.Show("Could not install application update.
 Please try again later,  or contact a system administrator.", "Application
 Update Error")
        Return
    Else
        If (e.Cancelled) Then
            MessageBox.Show("The application update has been cancelled.",
 "Application Update Cancelled")
            Return
        End If
    End If

    ADCheckForUpdateAsyncMin = ApplicationDeployment.CurrentDeployment
    If (e.MinimumRequiredVersion > ADCheckForUpdateAsyncMin.CurrentVersion)
 Then
        ' Launch an install of the minimum required version. 
        ADCheckForUpdateAsyncMin.UpdateAsync()
    End If
End Sub


Sub ADCheckForUpdateAsyncMin_UpdateCompleted(ByVal
 sender As Object, ByVal
 e As AsyncCompletedEventArgs) Handles ADCheckForUpdateAsyncMin.UpdateCompleted
    ' Alert user that update is complete.
    If Not (e.Error Is Nothing)
 Then
        MessageBox.Show("Could not install application update.
 We will try and upgrade the application later.", "Application
 Update Error")
        Return
    Else
        If (e.Cancelled) Then
            MessageBox.Show("The application update has been cancelled.",
 "Application Update Cancelled")
            Return
        End If
    End If

    MessageBox.Show("The update was successful. Your application
 will now be restarted.", "Restart Application")
    Application.Restart()
End Sub
ApplicationDeployment adCheckForUpdateAsyncMin;

private void CheckForUpdateAsyncMin()
{
    if (ApplicationDeployment.IsNetworkDeployed)
    {
        adCheckForUpdateAsyncMin = ApplicationDeployment.CurrentDeployment;
        adCheckForUpdateAsyncMin.CheckForUpdateCompleted += new
 CheckForUpdateCompletedEventHandler(adCheckForUpdateAsyncMin_CheckForUpdateCompleted);

        adCheckForUpdateAsyncMin.CheckForUpdate();
    }
}

void adCheckForUpdateAsyncMin_CheckForUpdateCompleted(object sender,
 CheckForUpdateCompletedEventArgs e)
{
    if (e.Error != null)
    {
        MessageBox.Show("Could not install application update. Please try
 again later,  or contact a system administrator.", "Application Update
 Error");
        return;
    }
    else if (e.Cancelled)
    {
        MessageBox.Show("The application update has been cancelled.", "Application
 Update Cancelled");
        return;
    }

    adCheckForUpdateAsyncMin = ApplicationDeployment.CurrentDeployment;
    if (e.MinimumRequiredVersion > adCheckForUpdateAsyncMin.CurrentVersion)
    {
        // Launch an install of the minimum required version. 
        adCheckForUpdateAsyncMin.UpdateCompleted += new AsyncCompletedEventHandler(adCheckForUpdateAsyncMin_UpdateCompleted);
        adCheckForUpdateAsyncMin.UpdateAsync();
    }
}

void adCheckForUpdateAsyncMin_UpdateCompleted(object sender, AsyncCompletedEventArgs
 e)
{
    // Alert user that update is complete.
    if (e.Error != null)
    {
        MessageBox.Show("Could not install application update. We will try
 and upgrade the application later.", "Application Update Error");
        return;
    }
    else if (e.Cancelled)
    {
        MessageBox.Show("The application update has been cancelled.", "Application
 Update Cancelled");
        return;
    }

    MessageBox.Show("The update was successful. Your application will now be
 restarted.", "Restart Application");
    Application.Restart();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CheckForUpdateCompletedEventArgs クラス
CheckForUpdateCompletedEventArgs メンバ
System.Deployment.Application 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

CheckForUpdateCompletedEventArgs.MinimumRequiredVersion プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CheckForUpdateCompletedEventArgs.MinimumRequiredVersion プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS