Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InsertParagraphOnlineRequest"/> class.
 /// </summary>
 /// <param name="document">The document.</param>
 /// <param name="paragraph">Paragraph data.</param>
 /// <param name="nodePath">The path to the node in the document tree.</param>
 /// <param name="loadEncoding">Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.</param>
 /// <param name="password">Password for opening an encrypted document.</param>
 /// <param name="destFileName">Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.</param>
 /// <param name="revisionAuthor">Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.</param>
 /// <param name="revisionDateTime">The date and time to use for revisions.</param>
 /// <param name="insertBeforeNode">The index of the node. A new paragraph will be inserted before the node with the specified index.</param>
 public InsertParagraphOnlineRequest(System.IO.Stream document, ParagraphInsert paragraph, string nodePath = null, string loadEncoding = null, string password = null, string destFileName = null, string revisionAuthor = null, string revisionDateTime = null, string insertBeforeNode = null)
 {
     this.Document         = document;
     this.Paragraph        = paragraph;
     this.NodePath         = nodePath;
     this.LoadEncoding     = loadEncoding;
     this.Password         = password;
     this.DestFileName     = destFileName;
     this.RevisionAuthor   = revisionAuthor;
     this.RevisionDateTime = revisionDateTime;
     this.InsertBeforeNode = insertBeforeNode;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PutParagraphRequest"/> class.
 /// </summary>
 /// <param name="name">The document name.</param>
 /// <param name="paragraph">Paragraph data.</param>
 /// <param name="folder">Original document folder.</param>
 /// <param name="storage">File storage, which have to be used.</param>
 /// <param name="loadEncoding">Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.</param>
 /// <param name="password">Password for opening an encrypted document.</param>
 /// <param name="destFileName">Result name of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.</param>
 /// <param name="revisionAuthor">Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.</param>
 /// <param name="revisionDateTime">The date and time to use for revisions.</param>
 /// <param name="nodePath">Path to node which contains paragraphs.</param>
 /// <param name="insertBeforeNode">Paragraph will be inserted before node with index.</param>
 public PutParagraphRequest(string name, ParagraphInsert paragraph, string folder = null, string storage = null, string loadEncoding = null, string password = null, string destFileName = null, string revisionAuthor = null, string revisionDateTime = null, string nodePath = null, string insertBeforeNode = null)
 {
     this.Name             = name;
     this.Paragraph        = paragraph;
     this.Folder           = folder;
     this.Storage          = storage;
     this.LoadEncoding     = loadEncoding;
     this.Password         = password;
     this.DestFileName     = destFileName;
     this.RevisionAuthor   = revisionAuthor;
     this.RevisionDateTime = revisionDateTime;
     this.NodePath         = nodePath;
     this.InsertBeforeNode = insertBeforeNode;
 }
Exemple #3
0
        public void TestPutParagraph()
        {
            var localName  = "test_multi_pages.docx";
            var remoteName = "TestPutParagraph.docx";
            var fullName   = Path.Combine(this.dataFolder, remoteName);
            var paragraph  = new ParagraphInsert {
                Text = "This is a new paragraph for your document"
            };

            this.StorageApi.PutCreate(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));

            var request = new PutParagraphRequest(remoteName, paragraph, this.dataFolder, nodePath: "sections/0");
            var actual  = this.WordsApi.PutParagraph(request);

            Assert.AreEqual(200, actual.Code);
        }