Создание стиля оформления

Ниже приведён пример использования операции SetWspMd для создания нового стиля на рабочем пространстве. В запросе передаётся шаблон, указывающий необходимость создания нового стиля. В ответе возвращаются настройки стиля.

SOAP-запрос:

<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">
<SetWspMd xmlns="http://www.fsight.ru/PP.SOM.Som">
<tWsp xmlns="">
  <id>S1!M!S!WSP1</id>
  </tWsp>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
<action>
  <CreateStyle>true</CreateStyle>
  </action>
  </pattern>
  <meta />
  </tArg>
  </SetWspMd>
  </s:Body>
  </s:Envelope>

SOAP-ответ:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetWspMdResult 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">
<id xmlns="">
  <id>S1!M!S!WSP1</id>
  </id>
<meta xmlns="">
<createdStyle>
  <Workspace />
  <Id>Style6</Id>
  <IsPrivate>1</IsPrivate>
  <ChildStyles />
  <TextFontFamilyName>Arial</TextFontFamilyName>
  <TextFontSize>10</TextFontSize>
  <TextFontStyleBold>0</TextFontStyleBold>
  <TextFontStyleItalic>0</TextFontStyleItalic>
  <TextFontStyleUnderline>0</TextFontStyleUnderline>
  <TextFontStyleStrikeout>0</TextFontStyleStrikeout>
  <TextFontBrushColor>4278190080</TextFontBrushColor>
  <TextFontBrushTransparent>0</TextFontBrushTransparent>
  <LinePenColor>4278190080</LinePenColor>
  <LinePenTransparent>0</LinePenTransparent>
  <LinePenWxDashStyle>Solid</LinePenWxDashStyle>
  <LinePenWidth>0.25</LinePenWidth>
  <LinePenCapSize>3</LinePenCapSize>
  <LinePenBeginWxCap>Flat</LinePenBeginWxCap>
  <LinePenEndWxCap>Flat</LinePenEndWxCap>
  <BackgroundBrushForeColor>-1</BackgroundBrushForeColor>
  <BackgroundBrushForeTransparent>0</BackgroundBrushForeTransparent>
  <BackgroundBrushPattern>Solid</BackgroundBrushPattern>
  <BackgroundBrushBackColor>4278190080</BackgroundBrushBackColor>
  <BackgroundBrushBackTransparent>0</BackgroundBrushBackTransparent>
  <ShadowBrushForeColor>4278190080</ShadowBrushForeColor>
  <ShadowBrushForeTransparent>0</ShadowBrushForeTransparent>
  <ShadowBrushPattern>None</ShadowBrushPattern>
  <ShadowBrushBackColor>-1</ShadowBrushBackColor>
  <ShadowBrushBackTransparent>0</ShadowBrushBackTransparent>
  <TextBackBrushColor>-1</TextBackBrushColor>
  <TextBackBrushTransparent>100</TextBackBrushTransparent>
  <TextPosition>Over</TextPosition>
  <TextAlignmentHorizontal>Center</TextAlignmentHorizontal>
  <TextAlignmentVertical>Center</TextAlignmentVertical>
  <TextMarginLeft>0</TextMarginLeft>
  <TextMarginTop>0</TextMarginTop>
  <TextMarginRight>0</TextMarginRight>
  <TextMarginBottom>0</TextMarginBottom>
  <PictureTransparent>0</PictureTransparent>
  <PictureAlignmentHorizontal>Center</PictureAlignmentHorizontal>
  <PictureAlignmentVertical>Center</PictureAlignmentVertical>
  <PictureMarginLeft>0</PictureMarginLeft>
  <PictureMarginTop>0</PictureMarginTop>
  <PictureMarginRight>0</PictureMarginRight>
  <PictureMarginBottom>0</PictureMarginBottom>
  <AdjustMode>None</AdjustMode>
  <WordWrap>BreakWords</WordWrap>
  <PictureProportional>0</PictureProportional>
  <PictureStretch>0</PictureStretch>
  <PictureAutoSize>0</PictureAutoSize>
  </createdStyle>
  </meta>
  </SetWspMdResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON-запрос:

{
"SetWspMd" :
{
"tWsp" :
{
"id" : "S1!M!S!WSP1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"action" :
{
"CreateStyle" : "true"
}
},
"meta" : ""
}
}
}

JSON-ответ:

{
"SetWspMdResult" :
{
"id" :
{
"id" : "S1!M!S!WSP1"
},
"meta" :
{
"createdStyle" :
{
"Workspace" : "",
"Id" : "Style6",
"IsPrivate" : "1",
"ChildStyles" : "",
"TextFontFamilyName" : "Arial",
"TextFontSize" : "10",
"TextFontStyleBold" : "0",
"TextFontStyleItalic" : "0",
"TextFontStyleUnderline" : "0",
"TextFontStyleStrikeout" : "0",
"TextFontBrushColor" : "4278190080",
"TextFontBrushTransparent" : "0",
"LinePenColor" : "4278190080",
"LinePenTransparent" : "0",
"LinePenWxDashStyle" : "Solid",
"LinePenWidth" : "0.25",
"LinePenCapSize" : "3",
"LinePenBeginWxCap" : "Flat",
"LinePenEndWxCap" : "Flat",
"BackgroundBrushForeColor" : "4294967295",
"BackgroundBrushForeTransparent" : "0",
"BackgroundBrushPattern" : "Solid",
"BackgroundBrushBackColor" : "4278190080",
"BackgroundBrushBackTransparent" : "0",
"ShadowBrushForeColor" : "4278190080",
"ShadowBrushForeTransparent" : "0",
"ShadowBrushPattern" : "None",
"ShadowBrushBackColor" : "4294967295",
"ShadowBrushBackTransparent" : "0",
"TextBackBrushColor" : "4294967295",
"TextBackBrushTransparent" : "100",
"TextPosition" : "Over",
"TextAlignmentHorizontal" : "Center",
"TextAlignmentVertical" : "Center",
"TextMarginLeft" : "0",
"TextMarginTop" : "0",
"TextMarginRight" : "0",
"TextMarginBottom" : "0",
"PictureTransparent" : "0",
"PictureAlignmentHorizontal" : "Center",
"PictureAlignmentVertical" : "Center",
"PictureMarginLeft" : "0",
"PictureMarginTop" : "0",
"PictureMarginRight" : "0",
"PictureMarginBottom" : "0",
"AdjustMode" : "None",
"WordWrap" : "BreakWords",
"PictureProportional" : "0",
"PictureStretch" : "0",
"PictureAutoSize" : "0"
}
}
}
}
public static SetWspMdResult WspCreateStyle(WspId moniker)
{
var somClient = new SomPortTypeClient(); //Прокси-объект для выполнения операций
//Параметры выполнения операции
var tSet = new SetWspMd()
{
tArg = new SetWspMdArg()
{
pattern = new WspMdPattern()
{
action = new IWrspWorkspaceAction()
{
CreateStyle = true
}
},
meta = new WspMd()
},
tWsp = moniker
};
//Создание стиля
var tResult = somClient.SetWspMd(tSet);
return tResult;
}

См. также:

SetWspMd: Операция