アドオンのインストール・レコードの取得
オブジェクト・ストアにインストール済みのすべてのアドオンとアップグレード・アドオンのアドオン・インストール・レコードを取得できます。
アドオン・インストール・レコードは、AddOnInstallationRecord オブジェクトとして表され、さまざまなインストール関連プロパティーが記載されています。以下の Java™ と C# の例に示すように、ObjectStore オブジェクトから AddOnInstallationRecordList コレクションを取得します。
Java の例
public void retrieveInstalledAddons(ObjectStore objectStore)
{
AddOnInstallationRecordList installList = objectStore.get_AddOnInstallationRecords();
AddOnInstallationRecord aoir = null;
Iterator iter = installList.iterator();
while (iter.hasNext())
{
aoir = (AddOnInstallationRecord)iter.next();
System.out.println("Addon name: " + aoir.get_AddOnName() + "¥n" +
"Install ID: " + aoir.get_Id().toString() + "¥n" +
"Install date: " + aoir.get_InstallationDate() + "¥n" +
"Installer: " + aoir.get_Installer() + "¥n" +
"Install status: " + aoir.get_InstallationStatus() + "¥n" +
"Install report: " + aoir.get_InstallationReport() + "¥n"
);
}
}
C# の例
public void retrieveInstalledAddons(IObjectStore objectStore)
{
IAddOnInstallationRecordList installList = objectStore.AddOnInstallationRecords;
IAddOnInstallationRecord aoir = null;
System.Collections.IEnumerator installIter = installList.GetEnumerator();
while (installIter.MoveNext())
{
aoir = (IAddOnInstallationRecord)installIter.Current;
System.Console.WriteLine("Addon name: " + aoir.AddOnName + "¥n" +
"Install ID: " + aoir.Id.ToString() + "¥n" +
"Install date: " + aoir.InstallationDate + "¥n" +
"Installer: " + aoir.Installer + "¥n" +
"Install status: " + aoir.InstallationStatus + "¥n" +
"Install report: " + aoir.InstallationReport + "¥n"
);
}
}