コード例 #1
0
        public static void ModifyInstanceASync(CimSession cimSession, string cimNamespace, string cimClassName)
        {
            try
            {
                CimInstance modifiedInstance = ModifyInstanceCore(cimSession, cimNamespace, cimClassName);
                if (modifiedInstance == null)
                {
                    Console.WriteLine("ModifyInstance operation not performed");
                    return;
                }

                CimAsyncResult<CimInstance> enumeratedInstances = cimSession.ModifyInstanceAsync(cimNamespace, modifiedInstance, GetOperationOptions());
                TestObserver<CimInstance> observer = new TestObserver<CimInstance>();
                IDisposable disposeable = enumeratedInstances.Subscribe(observer);
                observer.WaitForCompletion();
            }
            catch (CimException ex)
            {
                PrintCimException(ex);
            }
            catch( Exception ex)
            {
                Console.WriteLine(ex.Message);
            }            
        }