DocumentObject.Command Method
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.asTXSheetControl. Server TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Api. dll
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
Creates or updates a document-bound handle or queued operation; the owning workbook retains validation authority.
Syntax
public ObjectCommand Command(string method, object?[] args)
Parameters
| Parameter | Type | Optional | Description |
|---|---|---|---|
method | string | No | Operation-specific input; see this type's units and ownership contract. |
args | object?[] | No | Operation-specific input; see this type's units and ownership contract. |
Return Value
ObjectCommand. The operation result, returned asynchronously.
Examples
Create commands from a document-owned cell and apply them together through Workbook.BatchAsync.
using TXTextControl.TXSheetControl.Server;
async Task<byte[]> CreateInvoiceHeadingAsync(ServerSheetControl control)
{
var book = control.Workbook;
var sheet = await book.Sheets.AtAsync(0);
DocumentObject heading = sheet.Cell("A1");
await book.BatchAsync(batch =>
{
batch.Add(heading.Command("setText", "October invoice"));
batch.Add(heading.Command("format", new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" }));
});
return await control.SaveAsync(StreamType.PDF);
}
Remarks
Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.