Below is the example of using the GetDimElements operation to select elements and to get basic information about these elements. The request contains moniker of opened dictionary instance. The response contains basic information about the elements that includes element's key, name, level and availability of child elements, as well as summary information about elements selection.
{ "GetDimElements" : { "tDim" : { "id" : "S1!M!S!S1" }, "tArg" :
{ "selectionInfo" : "true", "changeSelection" : { "elSelectOp" : "Select", "elRelative" : "All", "limitElements" : "true" } } } }
{ "GetDimElementsResult" : { "els" : { "e" : [ { "n" : "Item 1", "k" : "1",
"h" : "0", "o" : "0" }, { "n" : "Item 2", "k" : "2", "h" : "0", "o" : "1" }, {
"n" : "Item 3", "k" : "3", "h" : "0", "o" : "2" }, { "n" : "Item 4", "k" : "4", "h" : "0", "o" : "0"
} ] }, "id" : { "id" : "S1!M!S!S1" }, "selectionInfo" : { "firstSelected" :
{ "n" : "Item 1", "a" : { "it" : [ "Item 1", "1", "1", "0",
"A000123" ] }, "ea" : { "it" : [ { "@v" : "Item 1" },
{ "@v" : "1" }, { "@v" : "1" }, { "@v" : "0" }, {
"@v" : "A000123" } ] }, "k" : "1", "h" : "0", "o" : "0" }, "lastSelected" : {
"n" : "Item 4", "a" : { "it" : [ "Item 4", "4", "4", "0", "A000126"
] }, "ea" : { "it" : [ { "@v" : "Item 4" }, {
"@v" : "4" }, { "@v" : "4" }, { "@v" : "0" }, { "@v" : "A000126"
} ] }, "k" : "4", "h" : "0", "o" : "0" }, "selectedCount" : "4" } } }
public static GetDimElementsResult SelectElementsBeforeGet(DmId moniker) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tElements = new GetDimElements() { tArg = new GetDimElementsArg() { //Selection parameters changeSelection = new DmSelectionArg() { elSelectOp = DmElSelectOp.Select, elRelative = DmElRelative.All, limitElements = true }, selectionInfo = true }, tDim = moniker }; //Get information on dictionary elements var result = somClient.GetDimElements(tElements); return result; }
See also: