示例#1
0
        public static void Run()
        {
            var apiInstance = new ReviewApi(Constants.GetConfig());

            try
            {
                var options = new ApplyRevisionsOptions
                {
                    SourceFile = new FileInfo {
                        FilePath = "source_files/word/source_with_revs.docx"
                    },
                    OutputPath = "output/result.docx"
                };

                var revisions = apiInstance.GetRevisions(new GetRevisionsRequest(options.SourceFile));

                foreach (var revision in revisions)
                {
                    revision.Action = RevisionInfo.ActionEnum.Accept;
                }

                options.Revisions = revisions;

                var response = apiInstance.ApplyRevisions(new ApplyRevisionsRequest(options));

                Console.WriteLine("ApplyRevisions: Output file link: " + response.Href);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling api: " + e.Message);
            }
        }
示例#2
0
        public static void Run()
        {
            var apiInstance = new ReviewApi(Constants.GetConfig());

            try
            {
                var sourceFile = new FileInfo
                {
                    FilePath = "source_files/word/source_with_revs.docx"
                };

                var request = new GetRevisionsRequest(sourceFile);

                var revisions = apiInstance.GetRevisions(request);
                Console.WriteLine("GetListOfRevisions: Revisions count: " + revisions.Count);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling api: " + e.Message);
            }
        }
示例#3
0
        public void GetRevisions()
        {
            var response = ReviewApi.GetRevisions(new GetRevisionsRequest(TestFiles.SourceWithRevs.ToFileInfo()));

            Assert.AreEqual(2, response.Count);
        }