CreateUploadOperationForCreateVideo() private static method

private static CreateUploadOperationForCreateVideo ( IStorageFile file, string token, BackgroundUploader uploader ) : Task
file IStorageFile
token string
uploader Windows.Networking.BackgroundTransfer.BackgroundUploader
return Task
        public async Task <string> CreateVideoAsync(IStorageFile file, Video v)
        {
            VideoSubmition videoSubmition = new VideoSubmition
            {
                Tags    = v.Tags,
                Title   = v.Title,
                Synopse = v.Synopse
            };

            Video createdVideo = null;

            try
            {
                using (EnsureCredentialsUseContext context = new EnsureCredentialsUseContext(
                           this.Username, this.Password, this.AccessKey, _client.InnerChannel))
                {
                    createdVideo = await this._client.AddVideoPostAsync(videoSubmition, null);
                }
            }
            catch (FaultException faultException)
            {
                MessageFault messageFault = faultException.CreateMessageFault();

                if (messageFault.HasDetail)
                {
                    string innerErrorXml;
                    using (var xmlReader = messageFault.GetReaderAtDetailContents())
                    {
                        innerErrorXml = xmlReader.ReadInnerXml();
                    }
                    if (innerErrorXml != null)
                    {
                        throw new Exception(innerErrorXml);
                    }
                    throw;
                }
            }

            string token = createdVideo.Token;

            BackgroundUploader uploader = new BackgroundUploader();

            UploadOperation uploadOperation =
                await VideosServiceClient.CreateUploadOperationForCreateVideo(file, token, uploader);

            await uploadOperation.StartAsync();

            return(await GetResponseMessage(uploadOperation));
        }