public CimMethodResult InvokeMethod(string namespaceName, CimInstance instance, string methodName, CimMethodParametersCollection methodParameters, CimOperationOptions options) { this.AssertNotDisposed(); if (instance != null) { if (!string.IsNullOrWhiteSpace(methodName)) { IEnumerable<CimInstance> cimSyncInstanceEnumerable = new CimSyncInstanceEnumerable(options, this.InstanceId, this.ComputerName, (CimAsyncCallbacksReceiverBase asyncCallbacksReceiver) => this.InvokeMethodCore(namespaceName, instance.CimSystemProperties.ClassName, instance, methodName, methodParameters, options, asyncCallbacksReceiver)); CimInstance cimInstance = cimSyncInstanceEnumerable.SingleOrDefault<CimInstance>(); if (cimInstance == null) { return null; } else { return new CimMethodResult(cimInstance); } } else { throw new ArgumentNullException("methodName"); } } else { throw new ArgumentNullException("instance"); } }
public CimInstance ModifyInstance(string namespaceName, CimInstance instance, CimOperationOptions options) { this.AssertNotDisposed(); if (instance != null) { IEnumerable<CimInstance> cimSyncInstanceEnumerable = new CimSyncInstanceEnumerable(options, this.InstanceId, this.ComputerName, (CimAsyncCallbacksReceiverBase asyncCallbacksReceiver) => this.ModifyInstanceCore(namespaceName, instance, options, asyncCallbacksReceiver)); return cimSyncInstanceEnumerable.SingleOrDefault<CimInstance>(); } else { throw new ArgumentNullException("instance"); } }
public bool TestConnection(out CimInstance instance, out CimException exception) { this.AssertNotDisposed(); bool flag = true; instance = null; exception = null; IEnumerable<CimInstance> cimSyncInstanceEnumerable = new CimSyncInstanceEnumerable(null, this.InstanceId, this.ComputerName, (CimAsyncCallbacksReceiverBase asyncCallbacksReceiver) => this.TestConnectionCore(null, asyncCallbacksReceiver)); try { instance = cimSyncInstanceEnumerable.SingleOrDefault<CimInstance>(); } catch (CimException cimException1) { CimException cimException = cimException1; exception = cimException; flag = false; } return flag; }
public CimMethodResult InvokeMethod(string namespaceName, string className, string methodName, CimMethodParametersCollection methodParameters, CimOperationOptions options) { this.AssertNotDisposed(); if (!string.IsNullOrWhiteSpace(methodName)) { IEnumerable<CimInstance> cimSyncInstanceEnumerable = new CimSyncInstanceEnumerable(options, this.InstanceId, this.ComputerName, (CimAsyncCallbacksReceiverBase asyncCallbacksReceiver) => this.InvokeMethodCore(namespaceName, className, null, methodName, methodParameters, options, asyncCallbacksReceiver)); CimInstance cimInstance = cimSyncInstanceEnumerable.SingleOrDefault<CimInstance>(); if (cimInstance == null) { return null; } else { return new CimMethodResult(cimInstance); } } else { throw new ArgumentNullException("methodName"); } }