Watch() public method

public Watch ( EventArrivedEventHandler handler ) : WmiWatchListener
handler EventArrivedEventHandler
return WmiWatchListener
 public Feature(string name, string advertise, string control, bool controlmustexist, IExceptionHandler exceptionhandler)
 {
     this.exceptionhandler = exceptionhandler;
     this.name             = name;
     wmisession            = WmiBase.Singleton.GetXenStoreSession("Citrix Xen Service Feature : " + name);
     wmisession.Log("New Feature");
     controlKey            = wmisession.GetXenStoreItem(control);
     this.controlmustexist = controlmustexist;
     try
     {
         if (controlKey.value != "")
         {
             wmisession.Log("Control key " + control + ":" + controlKey.value);
         }
     }
     catch {}
     enabled  = true;
     listener = controlKey.Watch(new EventArrivedEventHandler(onFeatureWrapper));
     if (!advertise.Equals(""))
     {
         advert = wmisession.GetXenStoreItem(advertise);
         features.Add(this);
     }
     Disposer.Add(this);
 }
 public ClipboardAccess(WmiSession wmisession)
 {
     this.wmisession   = wmisession;
     xsSetClipboard    = wmisession.GetXenStoreItem("data/set_clipboard");
     xsReportClipboard = wmisession.GetXenStoreItem("data/report_clipboard");
     serverwatch       = xsSetClipboard.Watch(new EventArrivedEventHandler(OnServerClipboard));
     clientwatch       = xsReportClipboard.Watch(new EventArrivedEventHandler(OnClientClipboard));
 }
Beispiel #3
0
 public NetInfo(IExceptionHandler exceptionhandler)
 {
     updating = new Object();
     this.exceptionhandler = exceptionhandler;
     wmisession            = WmiBase.Singleton.GetXenStoreSession("Adapters");
     devicevif             = wmisession.GetXenStoreItem("device/vif");
     datavif      = wmisession.GetXenStoreItem("data/vif");
     numvif       = wmisession.GetXenStoreItem("data/num_vif");
     needsRefresh = true;
     onAddrChange(null, null);
     addrChangeHandler = new NetworkAddressChangedEventHandler(onAddrChange);
     NetworkChange.NetworkAddressChanged += addrChangeHandler;
     vifListen = devicevif.Watch(onVifChanged);
 }
 public NetInfo(IExceptionHandler exceptionhandler)
 {
     updating = new Object();
     this.exceptionhandler = exceptionhandler;
     wmisession = WmiBase.Singleton.GetXenStoreSession("Adapters");
     devicevif = wmisession.GetXenStoreItem("device/vif");
     datavif = wmisession.GetXenStoreItem("data/vif");
     numvif =  wmisession.GetXenStoreItem("data/num_vif");
     needsRefresh = true;
     onAddrChange(null, null);
     addrChangeHandler = new NetworkAddressChangedEventHandler(onAddrChange);
     NetworkChange.NetworkAddressChanged += addrChangeHandler;
     vifListen = devicevif.Watch(onVifChanged);
 }
        public Feature(string name, string advertise, string control, bool controlmustexist, IExceptionHandler exceptionhandler)
        {
            this.exceptionhandler = exceptionhandler;
            this.name = name;
            wmisession = WmiBase.Singleton.GetXenStoreSession("Citrix Xen Service Feature : " + name);
            wmisession.Log("New Feature");
            controlKey = wmisession.GetXenStoreItem(control);
            this.controlmustexist = controlmustexist;
            try
            {
                if (controlKey.value != "")
                {
                    wmisession.Log("Control key "+control+":"+controlKey.value);
                }
            }
            catch {}
            enabled = true;
            listener = controlKey.Watch(new EventArrivedEventHandler(onFeatureWrapper));
            if (!advertise.Equals(""))
            {
                advert = wmisession.GetXenStoreItem(advertise);
                features.Add(this);

            }
            Disposer.Add(this);
        }
 public ClipboardAccess(WmiSession wmisession)
 {
     this.wmisession = wmisession;
     xsSetClipboard = wmisession.GetXenStoreItem("data/set_clipboard");
     xsReportClipboard = wmisession.GetXenStoreItem("data/report_clipboard");
     serverwatch = xsSetClipboard.Watch(new EventArrivedEventHandler(OnServerClipboard));
     clientwatch = xsReportClipboard.Watch(new EventArrivedEventHandler(OnClientClipboard));
 }