/// <summary> Apply the profile when the Sense Glove has loaded </summary> /// <param name="source"></param> /// <param name="args"></param> private void SenseGlove_OnGloveLoaded(object source, System.EventArgs args) { //check if a profile is already established for this glove. If not assign the name of this glove. string ID = this.senseGlove.GloveData().deviceID; string lastUsedName = UserProfiles.GetLastUser(ID); if (lastUsedName.Length > 0) { //a lastUsedName exits this.userName = lastUsedName; } else { //not been assigned yet, tell the database this is the new lastUser UserProfiles.SetLastUser(this.userName, ID); } this.SetProfile(UserProfiles.GetProfile(this.userName)); SenseGlove_Debugger.Log("Applied profile for " + userName); this.canUpdate = true; }