コード例 #1
0
 /// <summary>
 /// Event raised upon completion of CreateBobAsync.
 /// </summary>
 /// <param name="e"></param>
 private void OnCreateBlobCompleted(CreateBlobCompletedArgs e)
 {
     if (this.CreateBlobCompleted != null)
     {
         this.CreateBlobCompleted(this, e);
     }
 }
コード例 #2
0
        /// <summary>
        /// Creates a blob associated with a session.
        /// </summary>
        /// <param name="session">A Smash session object.</param>
        /// <param name="fileExtension">File extension for the blob.</param>
        /// <param name="state">State to be passed as userState in the completion event args.</param>
        public void CreateBlobAsync(SmashSession session, string fileExtension, object state)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            IAsyncResult asyncResult = SmashClientREST.CreateBlobAsync(
                session.ClientIdentity,
                session.MeetingToken,
                session.SessionID,
                session.ClientID,
                fileExtension,
                new ServiceAgent<Contracts.CreateBlobResponse>.OnCompleteDelegate(
                    (response) =>
                    {
                        CreateBlobCompletedArgs e = new CreateBlobCompletedArgs(response.Exception, response.Aborted, response.StateObject);
                        if (response.Exception == null && !response.Aborted)
                        {
                            SmashBlobUploader blobUploader = new SmashBlobUploader(session.ClientIdentity, session.MeetingToken, session.SessionID, session.ClientID, response.BlobAddress, response.BlobSharedSignature);

                            e.BlobUploader = blobUploader;
                        }
                        OnCreateBlobCompleted(e);
                    }),
                state);

            SmashClientREST.HandleCompletion(asyncResult, state);
        }