Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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));
 }
Esempio n. 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);
 }
Esempio n. 4
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);
 }
Esempio n. 5
0
 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;
     }
 }
Esempio n. 6
0
 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;
     }
 }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
 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));
 }