예제 #1
0
    //----------------------------------------------------------------------------------------------------------------------------------------------//

    public void Create()
    {
        creating = true;

        string uid = auth.CurrentUser.UserId.ToString();

        DataRef.CurrentUser().GetValueAsync().ContinueWith(async(task) => {
            await new WaitForUpdate();
            DataSnapshot snapshot = task.Result;
            SetReference("Group" + (snapshot.Child("Groups").ChildrenCount + 1).ToString(), groupName.text);
            snap = snapshot;
        });

        DataRef.Groups(groupName.text).Child("GroupName").SetValueAsync(groupName.text).ContinueWith(async(task) => { await new WaitForUpdate(); });
        DataRef.Groups(groupName.text).Child("GroupDescription").SetValueAsync(groupDescription.text).ContinueWith(async(task) => { await new WaitForUpdate(); });
        DataRef.Groups(groupName.text).Child("Contact").SetValueAsync(contact.text).ContinueWith(async(task) => { await new WaitForUpdate(); });
        DataRef.Groups(groupName.text).Child("Administrator").SetValueAsync(uid).ContinueWith(async(task) => {
            await new WaitForUpdate();
            ResetFields();
            dataGetSet.GetGroupInfo(snap);
            canvas.ToggleDoerSub(false);
            creating = false;
        });
    }