bool SetStyleSheetItem(string mon, StyleSheetItemMetadata meta)
mon. Moniker of single style in styles table.
meta. Style metadata that should be set.
The SetStyleSheetItem operation changes a style in styles table.
To execute the operation, in the mon field moniker of opened styles table instance with the !<style number> postfix, and in the meta field specify style metadata that should be applied. The moniker can be obtained on executing the OpenStyleSheet operation.
As a result, the operation always returns False.
Below is the example of changing style settings. The request contains style moniker and settings to be determined. The response contains whether settings were changed successfully.
{
"SetStyleSheetItem" :
{
"mon" : "CPDKLBGLHHOOFOAEEOBMIPONHEFJBEBEOLJEMAEIDCPLAAGC!M!S!SDJNKBJGLHHOOFOAENACKGIKGBKMHOKOEOJBIKCBEOKJJAPGE!2",
"meta" :
{
"h" :
{
"key" : "2",
"tag" : "TAB",
"name" : "Style1",
"id" : "I2"
},
"style" :
{
"Font" :
{
"@S" : "12",
"@F" : "Arial",
"@I" : "true"
}
}
}
}
}
{
"SetStyleSheetItemResult" : "0"
}
public static bool SetStyleSheetItem(string moniker, StyleSheetItem item)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetStyleSheetItem()
{
mon = moniker + '!' + item.key,
meta = new StyleSheetItemMetadata()
{
h = item,
style = new TabStyle()
{
Font = new TabFontStyle()
{
F = "Arial",
S = 12,
SSpecified = true,
I = true,
ISpecified = true
},
}
}
};
// Set up style
var result = somClient.SetStyleSheetItem(tSet);
return result;
}
See also: