Exemplo n.º 1
0
        public Task <object> InvokeManagedOperationAsync(string mobFullName, string methodName, object[] args)
        {
            var        mobContext = mobContextContainer.Get(mobFullName);
            MethodInfo method     = mobContext.InvokableMethodsByName.GetValueOrDefault(methodName)
                                    ?.FirstOrDefault(m => m.GetParameters().Length == args.Length);

            if (method == null)
            {
                var property = mobContext.InvokablePropertiesByName[methodName];
                if (args.Any())
                {
                    method = property.GetSetMethod();
                }
                else
                {
                    method = property.GetGetMethod();
                }
            }

            return(TaskUtilities.UnboxValueIfTaskAsync(method.Invoke(mobContext.Instance, args)));
        }
Exemplo n.º 2
0
 public ManagementObjectStateDto GetManagementObjectDescription(Guid mobId)
 {
     return(mobContextContainer.Get(mobId).StateDto);
 }