コード例 #1
0
ファイル: CimSession.cs プロジェクト: modulexcite/pash-1
		public CimMethodResult InvokeMethod(CimInstance instance, string methodName, CimMethodParametersCollection methodParameters)
		{
			if (instance != null)
			{
				if (instance.CimSystemProperties.Namespace != null)
				{
					return this.InvokeMethod(instance.CimSystemProperties.Namespace, instance, methodName, methodParameters);
				}
				else
				{
					throw new ArgumentNullException("instance", System.Management.Automation.Strings.CimInstanceNamespaceIsNull);
				}
			}
			else
			{
				throw new ArgumentNullException("instance");
			}
		}
コード例 #2
0
ファイル: CimMethodResult.cs プロジェクト: madewokherd/MMI
 internal CimMethodResult(CimInstance backingInstance)
 {
     Debug.Assert(backingInstance != null, "Caller should verify backingInstance != null");
     this._backingMethodParametersCollection = new CimMethodParametersCollection(backingInstance);
 }
コード例 #3
0
ファイル: CimMethodResult.cs プロジェクト: modulexcite/pash-1
 internal CimMethodResult(CimInstance backingInstance)
 {
     this._backingMethodParametersCollection = new CimMethodParametersCollection(backingInstance);
 }
コード例 #4
0
ファイル: CimSession.cs プロジェクト: modulexcite/pash-1
		private OperationHandle InvokeMethodCore(string namespaceName, string className, CimInstance instance, string methodName, CimMethodParametersCollection methodParameters, CimOperationOptions options, CimAsyncCallbacksReceiverBase asyncCallbacksReceiver)
		{
			OperationHandle operationHandle = null;
			InstanceHandle instanceHandle;
			InstanceHandle instanceHandleForMethodInvocation;
			SessionHandle sessionHandle = this._handle;
			MiOperationFlags operationFlags = options.GetOperationFlags();
			OperationOptionsHandle operationOptionsHandle = options.GetOperationOptionsHandle();
			string str = namespaceName;
			string str1 = className;
			string str2 = methodName;
			if (instance != null)
			{
				instanceHandle = instance.InstanceHandle;
			}
			else
			{
				instanceHandle = null;
			}
			if (methodParameters != null)
			{
				instanceHandleForMethodInvocation = methodParameters.InstanceHandleForMethodInvocation;
			}
			else
			{
				instanceHandleForMethodInvocation = null;
			}
			SessionMethods.Invoke(sessionHandle, operationFlags, operationOptionsHandle, str, str1, str2, instanceHandle, instanceHandleForMethodInvocation, options.GetOperationCallbacks(asyncCallbacksReceiver), out operationHandle);
			return operationHandle;
		}
コード例 #5
0
ファイル: CimSession.cs プロジェクト: modulexcite/pash-1
		public CimAsyncMultipleResults<CimMethodResultBase> InvokeMethodAsync(string namespaceName, string className, string methodName, CimMethodParametersCollection methodParameters, CimOperationOptions options)
		{
			this.AssertNotDisposed();
			if (!string.IsNullOrWhiteSpace(methodName))
			{
				IObservable<CimMethodResultBase> cimAsyncMethodResultObservable = new CimAsyncMethodResultObservable(options, this.InstanceId, this.ComputerName, (CimAsyncCallbacksReceiverBase asyncCallbacksReceiver) => this.InvokeMethodCore(namespaceName, className, null, methodName, methodParameters, options, asyncCallbacksReceiver));
				return new CimAsyncMultipleResults<CimMethodResultBase>(cimAsyncMethodResultObservable);
			}
			else
			{
				throw new ArgumentNullException("methodName");
			}
		}
コード例 #6
0
ファイル: CimSession.cs プロジェクト: modulexcite/pash-1
		public CimAsyncResult<CimMethodResult> InvokeMethodAsync(string namespaceName, string className, string methodName, CimMethodParametersCollection methodParameters)
		{
			IObservable<CimMethodResultBase> observable = this.InvokeMethodAsync(namespaceName, className, methodName, methodParameters, null);
			IObservable<CimMethodResult> convertingObservable = new ConvertingObservable<CimMethodResultBase, CimMethodResult>(observable);
			return new CimAsyncResult<CimMethodResult>(convertingObservable);
		}
コード例 #7
0
ファイル: CimSession.cs プロジェクト: modulexcite/pash-1
		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");
			}
		}
コード例 #8
0
ファイル: CimSession.cs プロジェクト: modulexcite/pash-1
		public CimMethodResult InvokeMethod(string namespaceName, string className, string methodName, CimMethodParametersCollection methodParameters)
		{
			return this.InvokeMethod(namespaceName, className, methodName, methodParameters, null);
		}