private void Initialize(string theComputerName, CimSession theCimSession, string theNameSpace, string theQueryDialect, string theQueryExpression, uint theOpreationTimeout) { this.enableRaisingEvents = false; this.status = CimIndicationWatcher.Status.Default; this.myLock = new object(); this.cimRegisterCimIndication = new CimRegisterCimIndication(); this.cimRegisterCimIndication.OnNewSubscriptionResult += new EventHandler <CimSubscriptionEventArgs>(this.NewSubscriptionResultHandler); this.cimSession = theCimSession; this.nameSpace = theNameSpace; this.queryDialect = ConstValue.GetQueryDialectWithDefault(theQueryDialect); this.queryExpression = theQueryExpression; this.opreationTimeout = theOpreationTimeout; this.computerName = theComputerName; }
private void Initialize(string theComputerName, CimSession theCimSession, string theNameSpace, string theQueryDialect, string theQueryExpression, uint theOpreationTimeout) { this.enableRaisingEvents = false; this.status = CimIndicationWatcher.Status.Default; this.myLock = new object(); this.cimRegisterCimIndication = new CimRegisterCimIndication(); this.cimRegisterCimIndication.OnNewSubscriptionResult += new EventHandler<CimSubscriptionEventArgs>(this.NewSubscriptionResultHandler); this.cimSession = theCimSession; this.nameSpace = theNameSpace; this.queryDialect = ConstValue.GetQueryDialectWithDefault(theQueryDialect); this.queryExpression = theQueryExpression; this.opreationTimeout = theOpreationTimeout; this.computerName = theComputerName; }
public void Stop() { object[] objArray = new object[1]; objArray[0] = this.status; DebugHelper.WriteLogEx("Status = {0}", 0, objArray); lock (this.myLock) { if (this.status == CimIndicationWatcher.Status.Started) { if (this.cimRegisterCimIndication != null) { DebugHelper.WriteLog("Dispose CimRegisterCimIndication object", 4); this.cimRegisterCimIndication.Dispose(); } this.status = CimIndicationWatcher.Status.Stopped; } } }
public void Start() { DebugHelper.WriteLogEx(); lock (this.myLock) { if (this.status == CimIndicationWatcher.Status.Default) { if (this.cimSession != null) { this.cimRegisterCimIndication.RegisterCimIndication(this.cimSession, this.nameSpace, this.queryDialect, this.queryExpression, this.opreationTimeout); } else { this.cimRegisterCimIndication.RegisterCimIndication(this.computerName, this.nameSpace, this.queryDialect, this.queryExpression, this.opreationTimeout); } this.status = CimIndicationWatcher.Status.Started; } } }