예제 #1
0
 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;
 }
예제 #2
0
		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;
		}
예제 #3
0
 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;
         }
     }
 }
예제 #4
0
 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;
         }
     }
 }
예제 #5
0
		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;
				}
			}
		}
예제 #6
0
		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;
				}
			}
		}