/// <summary> /// Creates a new smash session. /// </summary> /// <param name="identity">ClientIdentity object used for authentication.</param> /// <param name="meetingToken">The meeting token of the session to create. Needs to be shared to allow others to join the session.</param> /// <param name="subject">The name of the session.</param> /// <param name="organizer">The organizer of the session.</param> /// <param name="organizerEmail">email address of organizer of session.</param> /// <param name="attendees">List of user names allowed to join a session. A wildcard '*' matches all users attempting to join.</param> /// <param name="lifetime">The lifetime of the session. Can be up to 30 days. The session will automatically be erased after expiration of this timespan.</param> /// <param name="managementID">The owner's management secret required to enumerate, modify, wipe sessions.</param> /// <param name="state">State to be passed as userState in the completion event args.</param> public void CreateSessionAsync(ClientIdentity identity, Guid meetingToken, string subject, string organizer, string organizerEmail, IEnumerable<string> attendees, TimeSpan lifetime, Guid managementID, object state) { IAsyncResult asyncResult = SmashClientREST.CreateSessionAsync( identity, meetingToken, subject, organizer, organizerEmail, attendees, lifetime, managementID, new ServiceAgent<Contracts.CreateSessionResponse>.OnCompleteDelegate( (response) => { CreateSessionCompletedArgs e = new CreateSessionCompletedArgs(response.Exception, response.Aborted, response.StateObject); if (response.Exception == null && !response.Aborted) { e.MeetingToken = meetingToken; e.SessionID = response.SessionID; } OnCreateSessionCompleted(e); }), state); SmashClientREST.HandleCompletion(asyncResult, state); }
/// <summary> /// Event raised upon completion of CreateSessionAsync. /// </summary> /// <param name="e"></param> private void OnCreateSessionCompleted(CreateSessionCompletedArgs e) { if (this.CreateSessionCompleted != null) { this.CreateSessionCompleted(this, e); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SessionManager_CreateSessionCompleted(object sender, CreateSessionCompletedArgs e) { if (e.Error != null) { Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show(e.Error.ToString()); //this.Join.IsEnabled = true; //this.Create.IsEnabled = true; })); } else if (!e.Cancelled) { this.Dispatcher.BeginInvoke(() => { DataUse.Instance.RoomCreated = true; this.JoinMeeting(); }); } }