See below example of using the SetWspMd operation to create a new style on workspace. The request sends the template specifying if it is required to create a new style. The response returns style settings.
{
"SetWspMd" :
{
"tWsp" :
{
"id" : "S1!M!S!WSP1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"action" :
{
"CreateStyle" : "true"
}
},
"meta" : ""
}
}
}
{
"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(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetWspMd()
{
tArg = new SetWspMdArg()
{
pattern = new WspMdPattern()
{
action = new IWrspWorkspaceAction()
{
CreateStyle = true
}
},
meta = new WspMd()
},
tWsp = moniker
};
//Create a style
var tResult = somClient.SetWspMd(tSet);
return tResult;
}
See also: