Пример #1
0
        /// <summary>
        /// Removes annotations from document
        /// </summary>
        /// <param name="request">Request. <see cref="RemoveAnnotationsRequest" /></param>
        /// <returns><see cref="AnnotationApiLink"/></returns>
        public AnnotationApiLink RemoveAnnotations(RemoveAnnotationsRequest request)
        {
            // verify the required parameter 'options' is set
            if (request.options == null)
            {
                throw new ApiException(400, "Missing required parameter 'options' when calling RemoveAnnotations");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetServerUrl() + "/annotation/remove";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            var postBody = SerializationHelper.Serialize(request.options); // http body (model) parameter
            var response = this.apiInvoker.InvokeApi(
                resourcePath,
                "POST",
                postBody,
                null,
                null);

            if (response != null)
            {
                return((AnnotationApiLink)SerializationHelper.Deserialize(response, typeof(AnnotationApiLink)));
            }

            return(null);
        }
Пример #2
0
        public static void Run()
        {
            var apiInstance = new AnnotateApi(Constants.GetConfig());

            try
            {
                var fileInfo = new FileInfo {
                    FilePath = "one-page.docx"
                };
                var options = new RemoveOptions();
                options.FileInfo      = fileInfo;
                options.AnnotationIds = new List <int?> {
                    1, 2, 3
                };
                options.OutputPath = "Output/output.docx";
                var request = new RemoveAnnotationsRequest(options);

                var link = apiInstance.RemoveAnnotations(request);
                Console.WriteLine("DeleteAnnotations: Annotations deleted: " + link.Title);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling AnnotateApi: " + e.Message);
            }
        }