DiagnosticsSettings.GetForUser(User) メソッド

定義

指定したユーザーの診断設定を取得します。

public:
 static DiagnosticsSettings ^ GetForUser(User ^ user);
 static DiagnosticsSettings GetForUser(User const& user);
public static DiagnosticsSettings GetForUser(User user);
function getForUser(user)
Public Shared Function GetForUser (user As User) As DiagnosticsSettings

パラメーター

user
User

設定を取得するユーザー。

戻り値

ユーザーの現在の診断設定を含む settings オブジェクト。

// From a multi-user environment.
// (This example queries for all users, but you presumably
// know the user you want to query in your app.)

Task<IReadOnlyList<Windows.System.User>> getUsersTask =
    Windows.System.User.FindAllAsync().AsTask();
if (!getUsersTask.IsCompleted)
{
    getUsersTask.Wait();
}

IEnumerable<Windows.System.User> users = getUsersTask.Result;

foreach(Windows.System.User user in users)
{
    Windows.System.UserProfile.DiagnosticsSettings userSettings =
        Windows.System.UserProfile.DiagnosticsSettings.GetForUser(user);

    System.Diagnostics.Debug.WriteLine(user.NonRoamableId.ToString() +
        " user tailored experiences enabled: " +
        userSettings.CanUseDiagnosticsToTailorExperiences.ToString());
}

適用対象