OpenStyleSheetResult OpenStyleSheet(OdId tObject, OpenStyleSheetArg tArg)
tObject. Moniker of repository object that is a styles table.
tArg. Operation execution parameters.
The OpenStyleSheet operation opens styles table.
To execute the operation, in the tObject field specify moniker of object that is a styles table, and in the tArg field specify opening parameters. The object moniker can be obtained on executing the GetObjects operation. If the tArg.metaGet field is determined in parameters, style parameters are also loaded on opening styles table.
The operation results in the moniker of opened instance of styles table and style parameters if the tArg.metaGet field was defined.
The further work with styles is executed using the GetStyleSheet, CopyStyleSheet operations. To save changes, use the SaveObject, SaveObjectAs operations.
Below is the example of opening styles table. The request contains moniker of repository object that is a styles table. The response contains moniker of opened styles table instance.
{
"OpenStyleSheet" :
{
"tObject" :
{
"id" : "CPDKLBGLHHOOFOAEEOBMIPONHEFJBEBEOLJEMAEIDCPLAAGC!M!52741"
},
"tArg" :
{
"metaGet" : ""
}
}
}
{
"OpenStyleSheetResult" :
{
"id" :
{
"id" : "CPDKLBGLHHOOFOAEEOBMIPONHEFJBEBEOLJEMAEIDCPLAAGC!M!S!SDJNKBJGLHHOOFOAENACKGIKGBKMHOKOEOJBIKCBEOKJJAPGE"
},
"meta" :
{
"name" : "Styles table",
"type" : "0",
"items" :
{
"it" :
{
"key" : "1",
"tag" : "TAB",
"preview" : "iVBORw0KGgoAAAANSUhEUgAAAHgAAAAVCAYAAACNDipWAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHaSURBVGhD7ZXdcQMhDISvH1eQBtxFXITf8+oe3EfKSE8XwFrNInR\/43NyIcrMNxmDkBYtcEP6G4OuGcb7V9AjYXDnhMGds8rg67sGPngbxpsTFxwP8cyfzFySmXn+SmNnMZrHgmMya\/Dt4xFw+fTng+Mza7B3exkcgIb0pGPufH\/E4pk\/pfGyPh2aE68B8vzb9VvBK8Og9pRuzDefpEwa4\/xToGfeGptX95b+83hmr0sl+fzJ0qQ131sRqOYlKoPIzMZgagLX28NgrWX0Nbl53upydE4BA8uFkJyogZowrro8Rt+e5LwJf3Ivg\/lUa8wrDZbcroHp96sMrpCcVr+9xb9q8NITrTgCtYmyIfzfarBlleG2uUbfrMHp9zNPdMY7nLof2d8hbjBELX4PHIGVQbk5NmalwdyktQeu0W1qN7mtNvldtD15g5HTaj+EwRmvqcUIHnMEssGl0TZGGsdr9jK4xEmeMmZqLx2Aan8bDGb9yIl10M690BqmfsGpa\/fv9cgidfxJ0DxZ3LyMI1ANhkCKacyXNZ7BlrnNZNCERXgPjjbdywaDNRZwDTOHT5Z7+Dn+Jwz+S+QmVI0C0kQ+UP+BMLhzujM4qAmDOycM7pwwuHPU4KBXhvEbt9SBEBJ0pVAAAAAASUVORK5CYII=",
"name" : "Style for headers",
"id" : "I1"
}
}
}
}
}
public static OpenStyleSheetResult OpenStyleSheet(MbId mb, string id)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenStyleSheet()
{
tArg = new OpenStyleSheetArg() { metaGet = new StyleSheetMdPattern()},
tObject = new OdId { id = mb.id + "!" + FindObjectById(mb, id).k }
};
// Open styles table
var result = somClient.OpenStyleSheet(tOpen);
return result;
}
See also: