public System.Collections.Generic.IEnumerable <NativeCimInstance> QueryInstances(NativeDestinationOptions options, string namespaceName, string queryDialect, string queryExpression, bool keysOnly)
        {
            var context = new EnumerationContext(CimNamespaces.CimNamespace, new Filter(queryDialect, new CimEnumerationFilter {
                Namespace = namespaceName, Filter = queryExpression
            }), new Selector[0]);

            foreach (EndpointAddress address in _handler.Enumerate(context))
            {
                yield return(CimEnumerationHelper.CreateInstance(address));
            }
        }
        public System.Collections.Generic.IEnumerable <NativeCimInstance> QueryInstances(NativeDestinationOptions options, string namespaceName, string queryDialect, string queryExpression, bool keysOnly)
        {
            var client = CreateClient(options, queryDialect);

            foreach (EndpointAddress item in client.EnumerateEPR(new Uri(CimNamespaces.CimNamespace), new Filter(queryDialect, new CimEnumerationFilter {
                Namespace = namespaceName, Filter = queryExpression
            }), BatchSize))
            {
                yield return(CimEnumerationHelper.CreateInstance(item));
            }
        }
        public NativeCimInstance InvokeMethod(string namespaceName, string className, string methodName, NativeCimInstance instance, NativeCimInstance inSignature)
        {
            var classObj = new System.Management.ManagementClass(string.Format("//./{0}/{1}", namespaceName, className));
            var inObj    = classObj.GetMethodParameters(className);

            inObj.Properties["CommandLine"].Value = "notepad.exe";
            var result   = classObj.InvokeMethod(methodName, inObj, new System.Management.InvokeMethodOptions());
            var endpoint = CimEnumerator.ToEndointAddress(result, true);

            return(CimEnumerationHelper.CreateInstance(endpoint));
        }