GetDeclarationPointResult GetDeclarationPoint(OdId tObject, GetDeclarationPointArg tArg)
tObject. Moniker of the unit, which metadata should be obtained.
tArg. Operation execution parameters.
The GetDeclarationPoint operation gets information about the focused the development environment element.
The operation gets information about function or procedure if a custom method is used, or about property, method, interface, class if a system assembly is used. To execute the operation, in the tObject field specify unit moniker and in the tArg.cursor field specify the cursor layout coordinates in the code.
The operation results in the information about the focused development environment element.
Below is the example of getting information about development environment interface. The request contains unit moniker and indexes of the row and the column, in which the cursor is located. The response contains assembly and interface name.
{
"GetDeclarationPoint" :
{
"tObject" :
{
"id" : "S1!M!231517"
},
"tArg" :
{
"cursor" :
{
"col" : "11",
"row" : "5"
}
}
}
}
{
"GetDeclarationPointResult" :
{
"moduleName" : "Express",
"className" : "",
"identName" : "IEaxAnalyzerOptions"
}
}
public static GetDeclarationPointResult GetDeclarationPoint(MbId mb, string moduleId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetDeclarationPoint()
{
tArg = new GetDeclarationPointArg()
{
cursor = new CodePoint()
{
row = 5,
col = 11
}
},
//Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, moduleId).k }
};
//Start assembly
var result = somClient.GetDeclarationPoint(tGet);
return result;
}
See also: