Пример #1
0
        /// <summary>
        /// Saves the project asynchronously.
        /// </summary>
        /// <param name="project">The project.</param>
        public void SaveProjectAsync(Project project)
        {
            if (!this.isSaving)
            {
                this.isSaving = true;

                DataServiceClient client = this.CreateDataServiceClient();

                RCE.Services.Contracts.Project dataProject = DataServiceTranslator.ConvertToDataServiceProject(project);

                client.SaveProjectCompleted += (sender, args) =>
                {
                    this.isSaving = false;

                    if (args.Error != null)
                    {
                        client.Abort();
                        this.logger.Log(this.GetType().Name, args.Error);

                        if (args.Error.GetType() == typeof(Exception))
                        {
                            throw args.Error;
                        }

                        return;
                    }

                    this.OnSaveProjectCompleted(new DataEventArgs <bool>(args.Result));
                };

                client.SaveProjectAsync(dataProject);
            }
        }
        public void GenerateCompositeStreamManifest(Project project, Action <bool> success, Action <Exception> error)
        {
            BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None)
            {
                Name = "ExpressionEncoderServiceBinding",
                MaxReceivedMessageSize = 2147483647,
                MaxBufferSize          = 2147483647,
            };
            EndpointAddress endpointAddress = new EndpointAddress(this.serviceAddress);
            var             client          = new CompositeStreamManifestService.CompositeStreamManifestServiceClient(binding, endpointAddress);

            client.CreateCompositeStreamCompleted += (sender, e) =>
            {
                if (e.Error != null)
                {
                    error(e.Error);
                }
                else
                {
                    success(!e.Cancelled);
                }
            };
            var dsProject = DataServiceTranslator.ConvertToDataServiceProject(project);

            client.CreateCompositeStreamAsync(dsProject);
        }
Пример #3
0
        public void ShouldConvertProjectIntoAServiceProject()
        {
            var project = TranslatorHelper.CreateProject();

            var serviceProject = DataServiceTranslator.ConvertToDataServiceProject(project);

            TranslatorHelper.AssertProject(project, serviceProject);
        }
        public void GenerateCompositeStreamManifestAsync(Project project, string pbpDataStreamName, string adsDataStreamName, bool compressManifest, string manifestUri, string gapCmsId, string gapAzureId)
        {
            OutputServiceClient client = this.GetClient();

            client.GenerateCompositeStreamManifestCompleted += this.Client_GenerateCompositeStreamManifestCompleted;

            RCE.Services.Contracts.Project dataProject = DataServiceTranslator.ConvertToDataServiceProject(project);

            client.GenerateCompositeStreamManifestAsync(dataProject, pbpDataStreamName, adsDataStreamName, compressManifest, manifestUri, gapCmsId, gapAzureId);
        }
        public void GenerateOutputAsync(Project project)
        {
            OutputServiceClient client = this.GetClient();

            client.EnqueueJobCompleted += this.Client_EnqueueJobCompleted;

            RCE.Services.Contracts.Project dataProject = DataServiceTranslator.ConvertToDataServiceProject(project);

            client.EnqueueJobAsync(dataProject);
        }
Пример #6
0
        public void GenerateOutputAsync(Project project)
        {
            BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None)
            {
                Name = "ExpressionEncoderServiceBinding",
                MaxReceivedMessageSize = 2147483647,
                MaxBufferSize          = 2147483647,
            };

            EndpointAddress endpointAddress = new EndpointAddress(this.serviceAddress);

            ExpressionEncoderServiceClient client = new ExpressionEncoderServiceClient(binding, endpointAddress);

            client.EnqueueJobCompleted += this.Client_EnqueueJobCompleted;

            RCE.Services.Contracts.Project dataProject = DataServiceTranslator.ConvertToDataServiceProject(project);

            client.EnqueueJobAsync(dataProject);
        }
Пример #7
0
        /// <summary>
        /// Saves the project asynchronously.
        /// </summary>
        /// <param name="project">The project.</param>
        public void SaveProjectAsync(Project project)
        {
            if (!this.isSaving)
            {
                this.isSaving = true;

                DataServiceClient client = this.CreateDataServiceClient();

                RCE.Services.Contracts.Project dataProject = DataServiceTranslator.ConvertToDataServiceProject(project);

                string projectId = null;
                if (HtmlPage.Document.QueryString.TryGetValue("projectId", out projectId))
                {
                    dataProject.HighlightId = Guid.Parse(projectId);
                }

                client.SaveProjectCompleted += (sender, args) =>
                {
                    this.isSaving = false;

                    if (args.Error != null)
                    {
                        client.Abort();
                        this.logger.Log(this.GetType().Name, args.Error);

                        if (args.Error.GetType() == typeof(Exception))
                        {
                            throw args.Error;
                        }

                        return;
                    }

                    this.OnSaveProjectCompleted(new DataEventArgs <bool>(args.Result));
                };

                client.SaveProjectAsync(dataProject);
            }
        }