public VMModificationEventWatcher(VM vm, WMIEventHandler handler) : base( new WqlEventQuery(string.Format("Select * from __InstanceModificationEvent within 1 where targetinstance isa 'MsVM_ComputerSystem' and targetinstance.Name=\"{0}\"", vm.GUID)), new ManagementScope(@"\\" + vm.Host.Name + @"\root\virtualization", Utility.GetHostConnectionOptions(vm.Host)), handler) { }
public WMIEventWatcher(WqlEventQuery query, ManagementScope scope, WMIEventHandler handler) { watcher = new ManagementEventWatcher(scope, query); this.scope = scope; this.query = query; eventWatch = new Thread(new ParameterizedThreadStart(LookForEvent)); eventWatch.IsBackground = true; eventWatch.Start(handler); }
public VMSettingsModificationEventWatcher(VM vm, WMIEventHandler handler) : base( new WqlEventQuery( string.Format( "Select * from __InstanceOperationEvent within 1 where targetinstance isa 'Msvm_VirtualSystemSettingData' and targetinstance.SystemName=\"{0}\"", vm.GUID.ToString())), new ManagementScope(@"\\" + vm.Host.Name + @"\root\virtualization", vm.Host.HostConnectionOptions), handler) { }