public Invoke ( string className, string methodName, string args, System.Guid workspaceID, System.Guid dataListID ) : object | ||
className | string | The name of the class to be used. |
methodName | string | The name of the method to be invoked. |
args | string | The arguments to the method; this is typically a JSON string. |
workspaceID | System.Guid | The workspace ID. |
dataListID | System.Guid | The data list ID. |
return | object |
public object Invoke(string className, string methodName, string args, Guid workspaceID, Guid dataListID)
{
var serviceType = Type.GetType(string.Format(_typeNameFormat, className));
if(serviceType != null)
{
var method = serviceType.GetMethod(methodName);
if(method != null)
{
var service = method.IsStatic ? null : Activator.CreateInstance(serviceType);
var actionResult = method.Invoke(service, new object[] { args, workspaceID, dataListID });
if(actionResult != null)
{
return actionResult;
}
}
}
return null;
}