Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateTableRowFormatRequest"/> class.
 /// </summary>
 /// <param name="name">The filename of the input document.</param>
 /// <param name="tablePath">The path to the table in the document tree.</param>
 /// <param name="index">Object index.</param>
 /// <param name="format">Table row format.</param>
 /// <param name="folder">Original document folder.</param>
 /// <param name="storage">Original document storage.</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>
 public UpdateTableRowFormatRequest(string name, string tablePath, int index, TableRowFormat format, string folder = null, string storage = null, string loadEncoding = null, string password = null, string destFileName = null, string revisionAuthor = null, string revisionDateTime = null)
 {
     this.Name             = name;
     this.TablePath        = tablePath;
     this.Index            = index;
     this.Format           = format;
     this.Folder           = folder;
     this.Storage          = storage;
     this.LoadEncoding     = loadEncoding;
     this.Password         = password;
     this.DestFileName     = destFileName;
     this.RevisionAuthor   = revisionAuthor;
     this.RevisionDateTime = revisionDateTime;
 }
        public void TestUpdateTableRowFormat()
        {
            var localName  = "TablesGet.docx";
            var remoteName = "TestUpdateTableRowFormat.docx";
            var fullName   = Path.Combine(this.dataFolder, remoteName);
            var rowFormat  = new TableRowFormat {
                AllowBreakAcrossPages = true, HeadingFormat = true, Height = 10, HeightRule = TableRowFormat.HeightRuleEnum.Auto
            };

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

            var request = new UpdateTableRowFormatRequest(remoteName, "sections/0/tables/2", 0, this.dataFolder, format: rowFormat);
            var actual  = this.WordsApi.UpdateTableRowFormat(request);

            Assert.AreEqual(200, actual.Code);
        }
Esempio n. 3
0
        public static void UpdateTableRowFormat()
        {
            string         name      = "updateTableRowFormat.docx";
            string         tablePath = "Section/0/Body/0/Table/0";
            int?           index     = 0;
            TableRowFormat format    = new TableRowFormat
            {
                Height           = 100,
                HeightType       = TableRowFormat.HeightTypeEnum.Exactly,
                BreakAcrossPages = true,
                Header           = true
            };
            string folder       = "input";
            string storage      = null;
            string password     = null;
            string destFilePath = "output/UpdateTableRowFormat_output.docx";

            tablesApi.UpdateTableRowFormat(name, tablePath, index, format, destFilePath, folder, storage, password);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateTableRowFormatOnlineRequest"/> class.
 /// </summary>
 /// <param name="document">The document.</param>
 /// <param name="tablePath">The path to the table in the document tree.</param>
 /// <param name="format">Table row format.</param>
 /// <param name="index">Object index.</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>
 public UpdateTableRowFormatOnlineRequest(System.IO.Stream document, string tablePath, TableRowFormat format, int index, string loadEncoding = null, string password = null, string destFileName = null, string revisionAuthor = null, string revisionDateTime = null)
 {
     this.Document         = document;
     this.TablePath        = tablePath;
     this.Format           = format;
     this.Index            = index;
     this.LoadEncoding     = loadEncoding;
     this.Password         = password;
     this.DestFileName     = destFileName;
     this.RevisionAuthor   = revisionAuthor;
     this.RevisionDateTime = revisionDateTime;
 }