Exemple #1
0
    protected void btnUpProviderUpdate_Click(object sender, EventArgs e)
    {
        string pvName = lblUpProviderName.Text;

        foreach (ProviderInfo info in _installedProviders)
        {
            if (info.Name == pvName)
            {
                try
                {
                    // download the update info
                    ProviderUpdateInfo updateInfo = ProvidersUpdater.DownloadProviderUpdateInfo(info);

                    // download package and install it
                    if (ProvidersUpdater.Install(updateInfo))
                    {
                        DisplayProviderUpdate(updateInfo, info, true, null);
                    }
                    else
                    {
                        DisplayProviderUpdate(null, info, false, "Update installation failed!");
                    }
                }
                catch
                {
                    DisplayProviderUpdate(null, info, false, "Update installation failed!");
                }
                return;
            }
        }
    }
Exemple #2
0
    protected void btnProviderUpdateCheckClick(object sender, EventArgs e)
    {
        Button btn = (Button)sender;

        if (btn.CommandName == "Update")
        {
            string pvName = btn.CommandArgument;
            foreach (ProviderInfo info in _installedProviders)
            {
                if (info.Name == pvName)
                {
                    try
                    {
                        ProviderUpdateInfo updateInfo = ProvidersUpdater.DownloadProviderUpdateInfo(info);
                        DisplayProviderUpdate(updateInfo, info, false, null);
                    }
                    catch
                    {
                        DisplayProviderUpdate(null, info, false, null);
                    }
                    return;
                }
            }
        }
    }