コード例 #1
0
        private static async void InitializeAppRequirements()
        {
            using (var userGroups = new UserGroups())
            {
                var userGroup = await userGroups.GetUserGroup("User").ConfigureAwait(false);

                if (userGroup != null)
                {
                    return;
                }
                if (await userGroups.AddUserGroup(new UserGroup {
                    Group = "User"
                }).ConfigureAwait(false) !=
                    HttpStatusCode.Created)
                {
                    GrToast.SmallToast(GrToast.Errors.NetworkError);
                    return;
                }

                if (await userGroups.AddUserGroup(new UserGroup {
                    Group = "Admin"
                }).ConfigureAwait(false) !=
                    HttpStatusCode.Created)
                {
                    GrToast.SmallToast(GrToast.Errors.NetworkError);
                }
            }
        }