SetStyleSheetItem

Syntax

bool SetStyleSheetItem(string mon, StyleSheetItemMetadata meta)

Parameters

mon. Moniker of single style in styles table.

meta. Style metadata that should be set.

Description

The SetStyleSheetItem operation changes a style in styles table.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetStyleSheetItem xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">CPDKLBGLHHOOFOAEEOBMIPONHEFJBEBEOLJEMAEIDCPLAAGC!M!S!SDJNKBJGLHHOOFOAENACKGIKGBKMHOKOEOJBIKCBEOKJJAPGE!2</mon>
<meta xmlns="">
<h>
  <key>2</key>
  <tag>TAB</tag>
<name>Style1</name>
  <id>I2</id>
  </h>
<style>
  <Font F="Arial" S="12" I="true" />
  </style>
  </meta>
  </SetStyleSheetItem>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <SetStyleSheetItemResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">0</SetStyleSheetItemResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"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"
}
}
}
}
}

JSON response:

{
"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:

Working with Styles Table