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)); }
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); }
protected virtual void Finish() { if (advert != null) { if (advert != null) { try { advert.Remove(); } catch { }; } features.Remove(this); advert = null; } if (listener != null) { listener.Dispose(); listener = null; } }
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); }